我現在正在GAE中開發一個java Google雲端點。在端點內部,它將嘗試連接到Firebase服務器以獲取一些數據。Google App Engine中的Firebase初始化錯誤
然而,當我創建我的端點火力地堡對象,
Firebase ref = new Firebase(<My Firebase URL>);
GAE引發以下錯誤:
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 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)
at java.util.concurrent.Executors$DefaultThreadFactory.newThread(Executors.java:572)
at com.firebase.client.utilities.DefaultRunLoop$FirebaseThreadFactory.newThread(DefaultRunLoop.java:25)
at java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:600)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1635)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:307)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:526)
at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:615)
at com.firebase.client.utilities.DefaultRunLoop.scheduleNow(DefaultRunLoop.java:57)
at com.firebase.client.core.Repo.scheduleNow(Repo.java:176)
at com.firebase.client.core.Repo.<init>(Repo.java:58)
at com.firebase.client.core.RepoManager.getLocalRepo(RepoManager.java:46)
at com.firebase.client.core.RepoManager.getRepo(RepoManager.java:19)
at com.firebase.client.Firebase.<init>(Firebase.java:194)
at com.firebase.client.Firebase.<init>(Firebase.java:199)
at com.firebase.client.Firebase.<init>(Firebase.java:177)
我使用火力地堡客戶端2.2.3。看起來GAE似乎不允許應用程序創建新線程。任何想法?
實際上,你可以運行使用基本或手動縮放線程,而通過設置管理VM的所有麻煩去,唯一的限制是自動縮放:https://cloud.google.com/appengine/docs/ java/modules /#Java_Background_threads –