appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.30'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.firebase:firebase-client-jvm:2.5.0'
compile 'org.apache.httpcomponents:httpclient:4.5.1'
In spite following those directions - although I clearly may have done SOMETHING wrong. Following is part of the error log on GAE:
W 11:28:01.224 /hello java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:382) at java.security.AccessController.checkPermission(AccessController.java:572) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:55) at com.google.apphosting.runtime.security.CustomSecurityManager.checkAccess(CustomSecurityManager.java:136) 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:675) ...Based on this tutorial, and on what I've read elsewhere, I thought that by setting to a threadsafe version that the Servlet would run. This is the code the Servlet is trying to run:@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
Log.warning ("Running.");
Firebase firebaseRecord = new Firebase("https://sampletest.firebaseio.com/");
firebaseRecord.child("fullName").setValue("Alan Turing");
}Questions:- Has anyone else tried to implement the tutorial?- Has anyone run into problems with thread prevention on GAE and how have they dealt with it?- Any other hints on what we might be missing? The tutorial seemed so simple but we're stuck on how to resolve.
"To use Firebase with App Engine, you must use manual scaling. This is because Firebase uses background threads to listen for changes and App Engine only allows long-lived background threads on manually scaled backend instances."
Look for the section titled "Configure the App Engine Backend to use manual scaling"
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myApplicationId</application>
<version>1</version>
<threadsafe>true</threadsafe>
<manual-scaling>
<instances>1</instances>
</manual-scaling>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
</system-properties>
</appengine-web-app>
Log.warning ("Running.");
I feel like I must be overlooking some simple thing.
at java.lang.Thread.<init>(Thread.java:675)
Class c = Class.forName("com.google.appengine.api.ThreadManager");
|
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.30'
the above line downloads the appengine sdk so you can execute commands such as appcfg.
I feel stupid of course, and grateful for your help!
Success:
Thanks again.