Google App Engine : java.lang.RuntimePermission

My client: Google App Engine. Server: Compute Engine, Aerospike Installed.

AerospikeClient client = new AerospikeClient("xxx.xxx.xx.xx", 3000);
	Key key = new Key("test", "demo", "putgetkey");
	Bin bin1 = new Bin("bin1", "value1");
	Bin bin2 = new Bin("bin2", "value2");

	// Write a record
	client.put(null, key, bin1, bin2);

	// Read a record
	Record record = client.get(null, key);
	client.close();

Above code is ok when i use main function, but when i deploy to google app engine, i got error:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
at java.security.AccessController.checkPermission(AccessController.java:559)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:429)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkAccess(DevAppServerFactory.java:454)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
at java.lang.Thread.init(Thread.java:391)
at java.lang.Thread.init(Thread.java:349)
at java.lang.Thread.<init>(Thread.java:461)
at com.aerospike.client.cluster.Cluster.initTendThread(Cluster.java:163)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:195)
at com.aerospike.client.AerospikeClient.<init>(AerospikeClient.java:160)

Any idea to solve this problem ? Thank you.

GAE does not allow front end instances (GAE instances) to spawn threads, and an attempt to do so results in AccessControlException.

You will need to run the Aerospike client on a GCE machine and then use your GAE application to connect to the GCE machine instead of running the Aerospike Client on GAE.

We are looking into it to see if we can make our client GAE compatible. The other way would be to create an app layer on top of the client on GCE and connect to it from your GAE app using single threaded calls.

1 Like

I’ll waiting for your client GAE compatible. Thank you very much.

hi,

There is presently no timeline for a GAE compatible client.

I am using Webcam Capture library for my project which is using Thread and because of that I am getting

com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:55)

this is really stupid.

Now I have two options 1) Change the library or 2) replace GAE with something like Openshift etc.

@Biswajit_Roy,

Thank you for your interest in the GAE-compatible client.

Unfortunately, this is not something that we are planning to work on right now. Please use the aforementioned workaround in the meantime.