[Business Logic] Permission Error

I got the following error when I tried to initialize Braintree into my custom logic code:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.backendless.coderunner.runtime.task.EventInvocationTask.runImpl(EventInvocationTask.java:97)
at com.backendless.coderunner.runtime.concurrent.ExtendedRunnable.run(ExtendedRunnable.java:22)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
at com.backendless.pack_app.events.custom_events.RequestTokenEventHandler.handleEvent(RequestTokenEventHandler.java:61)
… 7 more
Caused by: java.security.AccessControlException: access denied (“java.lang.RuntimePermission” “getenv.*”)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at com.backendless.coderunner.runtime.security.CodeRunnerSecurityManager.checkPermission(CodeRunnerSecurityManager.java:67)
at java.lang.System.getenv(System.java:944)
at com.braintreegateway.Environment.developmentBaseURL(Environment.java:32)
at com.braintreegateway.Environment.<clinit>(Environment.java:10)
… 8 more
This is my code:

@Override 
public Map handleEvent( RunnerContext context, Map eventArgs )
{
 Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();


 BraintreeGateway gateway = new BraintreeGateway(Environment.SANDBOX, MERCHANT_ID, PUBLIC_KEY, PRIVATE_KEY);
 map.put(KEY_TOKEN, gateway.clientToken().generate());
 return map;
}

Hi Chau Ha,

We’re investigating the problem and will update you on our findings shortly.

Regards,
Mark

Hi, Chau Ha,
Seems like you’re trying to retrieve some environment variable. Why would you need that in your business logic code?

Hi Sergey,
This is the Enviroment.java file: https://github.com/braintree/braintree_java/blob/master/src/main/java/com/braintreegateway/Environment.java

I need that in my business code because I’m following this instruction to initialize Braintree: https://developers.braintreepayments.com/android+java/start/hello-server

We fixed this problem.
All changes will take effect on next week.
We will notify you when this happen.

Thank you for your fast response.

Hi Chau Ha Thai .
Can you try to run you code in this version of CodeRunner (in DEBUG mode) ?
http://dl.free.fr/nfHcgcLR6

Hi Chau Ha,

Please use this link instead to download the file Oleg shared with you:

Regards,
Mark