java.security.AccessControlException

Getting AccessControlException: (java.security.AccessControlException: You have no permission to create thread in CodeRunner secure group.) while running cusom business logic serivce…
My service is just opening a http connection and nothing more… Any advice how to fix this ? I’m on backendless cloud v4+

Hi Qasim

Please provide code sample where you’re establishing http connection. This error means that you’ve reached the limit of Java threads in business logic. The limit on free plan is 1 thread.

Regards Anton

Hello Anton, i’ve attached my service which is using jsoup to fetch a web page and scrap onwards…

service.txt (806B)

Qasim,

I’ve created an internal ticket BKNDLSS-15786 to investigate the issue. One of our developers will get back to you with results.

Regards Anton

ok, i’m on standby any eta ?

Not yet, we’ll include this issue to the roadmap. I’ll notify you here as soon as the approximate eta will be known.
Meanwhile you may try establishing http connection by yourself, as this issue is related to the integration of jsoup library.

Best regards

Hi, I have the same problem. One of my libraries uses json library to establish a connection with a second server for process payments, when the library try to read the response from the server in this line:

responseCode = this.connection.getResponseCode();

I get:

AccessControlException: (java.security.AccessControlException: You have no permission to create thread in CodeRunner secure group.)

I know the free plan is limited to 1 thread, so I created a new account for test the cloud99 to reach 5 threads (to test if upgrade to plan 99 would be the solution), but I have the same error, so I played with the threads inside server code with this:

Threads t2=new Threads().PrimeThread(90*2);
t2.run();

Threads t3=new Threads().PrimeThread(90*3);
t3.run();

Threads t4=new Threads().PrimeThread(90*4);
t4.run();

etc…

from 1 to 4 new extra threads it works fine but when I tried to attach the 6th thread(1 main and 5 extras) I got the error:


400 - Type:"java.security.AccessControlException", Description:"Cannot allocate new thread. You can remove this limitation by purchasing a function pack in Backendless Marketplace.", ExceptionClass:"ServiceException" {Msg:"none", Cause:"none"}

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #454545}

So the trial 99 is working fine, I have a maximum of 5 threads(1 main and 4 extras) but the error is different from the first one(json library error), so I guess this error is other than the number of threads.

This might give us a hint, thanks for your investigation.

Also i tried to send http request manually instead of using Jsoup library but found the same issue, seems like there’s a problem when you open a http connection or something like that…