Appengine DevMode : access denied (“java.lang.RuntimePermission” “accessClassInPackage.sun.security.util”)

为君一笑 提交于 2020-01-19 06:20:46

问题


I upgraded my PC to Ubuntu 12.04 and restored the backup of my workspace and Eclipse afterwards. Now when I try to start my AppEngine/GWT application I run into a problem with the java security manager.

Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.util")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
    at java.security.AccessController.checkPermission(AccessController.java:555)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:252)

I am using appengine SDK 1.6.4 and Objectify4

My java version is

OpenJDK Runtime Environment (IcedTea7 2.1) (7~u3-2.1-1ubuntu3) OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

I already tried to go back to jdk 6 but that did not help. I also have tried to fix this by making changes to the java.policy file and defining a local policy file. No luck so far. I downloaded the AppEngine SDK sources from svn but the line numbers do not really match, but I can see that a more restrictive securiy manager is setup.

The full stack trace here ... any help appreciated :

java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:224)
    at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
    at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
    at sun.security.jca.ProviderList.getProvider(ProviderList.java:232)
    at sun.security.jca.ProviderList.getService(ProviderList.java:330)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:157)
    at java.security.Security.getImpl(Security.java:695)
    at java.security.AlgorithmParameters.getInstance(AlgorithmParameters.java:146)
    at sun.security.x509.AlgorithmId.decodeParams(AlgorithmId.java:121)
    at sun.security.x509.AlgorithmId.<init>(AlgorithmId.java:114)
    at sun.security.x509.AlgorithmId.parse(AlgorithmId.java:381)
    at sun.security.x509.X509Key.parse(X509Key.java:168)
    at sun.security.x509.CertificateX509Key.<init>(CertificateX509Key.java:75)
    at sun.security.x509.X509CertInfo.parse(X509CertInfo.java:705)
    at sun.security.x509.X509CertInfo.<init>(X509CertInfo.java:169)
    at sun.security.x509.X509CertImpl.parse(X509CertImpl.java:1747)
    at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:196)
    at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:97)
    at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:747)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    at java.security.KeyStore.load(KeyStore.java:1214)
    at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.getTrustStore(LocalURLFetchService.java:190)
    at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.createValidatingScheme(LocalURLFetchService.java:206)
    at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.createHttpClient(LocalURLFetchService.java:252)
    at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.init(LocalURLFetchService.java:298)
    at com.google.appengine.api.channel.dev.LocalChannelService.createFetchService(LocalChannelService.java:83)
    at com.google.appengine.api.channel.dev.LocalChannelService.init(LocalChannelService.java:62)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:581)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.access$700(ApiProxyLocalImpl.java:46)
    at com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:564)
    at com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:562)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:561)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.resolveDeadline(ApiProxyLocalImpl.java:233)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.doAsyncCall(ApiProxyLocalImpl.java:214)
    at com.google.appengine.tools.development.ApiProxyLocalImpl.makeSyncCall(ApiProxyLocalImpl.java:147)
    at com.googlecode.objectify.cache.TriggerFutureHook.makeSyncCall(TriggerFutureHook.java:154)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:112)
    at com.googlecode.objectify.cache.TriggerFutureHook$1.invoke(TriggerFutureHook.java:212)
    at $Proxy35.makeSyncCall(Unknown Source)
    at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:101)
    at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:50)
    at com.google.appengine.api.channel.ChannelServiceImpl.createChannelImpl(ChannelServiceImpl.java:59)
    at com.google.appengine.api.channel.ChannelServiceImpl.createChannel(ChannelServiceImpl.java:34)
    at com.klawt.server.NavLinkApp.setupUser(NavLinkApp.java:71)
    at com.klawt.server.NavLinkApp.handle(NavLinkApp.java:47)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Router.doHandle(Router.java:431)
    at org.restlet.routing.Router.handle(Router.java:648)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
    at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:84)
    at org.restlet.Application.handle(Application.java:377)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Router.doHandle(Router.java:431)
    at org.restlet.routing.Router.handle(Router.java:648)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.routing.Router.doHandle(Router.java:431)
    at org.restlet.routing.Router.handle(Router.java:648)
    at org.restlet.routing.Filter.doHandle(Filter.java:159)
    at org.restlet.routing.Filter.handle(Filter.java:206)
    at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
    at org.restlet.Component.handle(Component.java:392)
    at org.restlet.Server.handle(Server.java:516)
    at org.restlet.engine.ServerHelper.handle(ServerHelper.java:72)
    at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
    at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1089)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:60)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:78)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:369)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.util")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
    at java.security.AccessController.checkPermission(AccessController.java:555)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:252)
    at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1529)
    at java.lang.ClassLoader$1.run(ClassLoader.java:490)
    at java.lang.ClassLoader$1.run(ClassLoader.java:488)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:488)
    at sun.security.pkcs11.SunPKCS11.<clinit>(SunPKCS11.java:63)
    ... 121 more

回答1:


After trying different Appengine SDK versions, switching between openJDK 6 & 7 and I finally removed openJDK all along and download Oracle JDK 6, setup JAVA_HOME and PATH.

Oracle JDK works !

So it is a Ubuntu 12.04 / OpenJDK issue.



来源:https://stackoverflow.com/questions/10034900/appengine-devmode-access-denied-java-lang-runtimepermission-accessclassinp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!