GWT:java.security.AccessControlException:访问被拒绝

时间:2015-06-08 00:17:12

标签: gwt

我不确定为什么会发生这种情况:我改变的是我从经典开发模式转到超级开发模式 - 我不记得为什么我这样做了因为从那时起我又再次( !)试图让这个运行。我不知道我改变了什么因素,但现在我得到了这个:

Jun 08, 2015 1:57:41 AM com.google.apphosting.utils.security.SecurityManagerInstaller install
WARNING: Unable to delete dynamic policy file: C:\Users\Stefan\AppData\Local\Temp\test798307262776049603.policy
java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Users\Stefan\AppData\Local\Temp\test798307262776049603.policy" "delete")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkDelete(Unknown Source)
    at java.io.File.delete(Unknown Source)
    at com.google.apphosting.utils.security.SecurityManagerInstaller.install(SecurityManagerInstaller.java:107)
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:251)
    at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:76)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:60)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:632)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1054)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
    at com.google.gwt.dev.DevMode.main(DevMode.java:413)

Unable to start embedded HTTP server
java.lang.RuntimeException: Unable to create a DevAppServer
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:266)
    at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
    at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:76)
    at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:60)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:632)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1054)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
    at com.google.gwt.dev.DevMode.main(DevMode.java:413)
Caused by: java.security.AccessControlException: access denied ("java.security.SecurityPermission" "getPolicy")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.security.Policy.getPolicy(Unknown Source)
    at com.google.apphosting.utils.security.SecurityManagerInstaller.install(SecurityManagerInstaller.java:104)
    at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:251)
    ... 12 more
[ERROR] Failure in unit cache map load.
java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "E:\java\mahlzeit-web\mahlzeit-web\gwt-unitCache\gwt-unitCache-c04dfa348afbdd12c2a9ddc3bc36901a78fa6812-0000014DD072583D" "read")
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at com.google.gwt.dev.javac.PersistentUnitCache.awaitUnitCacheMapLoad(PersistentUnitCache.java:523)
    at com.google.gwt.dev.javac.PersistentUnitCache.find(PersistentUnitCache.java:428)
    at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
    at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
    at com.google.gwt.dev.codeserver.Recompiler.initWithoutPrecompile(Recompiler.java:200)
    at com.google.gwt.dev.codeserver.Outbox.maybePrecompile(Outbox.java:82)
    at com.google.gwt.dev.codeserver.Outbox.<init>(Outbox.java:61)
    at com.google.gwt.dev.codeserver.CodeServer.makeOutboxes(CodeServer.java:156)
    at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:118)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:91)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.SuperDevListener$1.run(SuperDevListener.java:84)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "E:\java\mahlzeit-web\mahlzeit-web\gwt-unitCache\gwt-unitCache-c04dfa348afbdd12c2a9ddc3bc36901a78fa6812-0000014DD072583D" "read")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkRead(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at com.google.gwt.dev.javac.PersistentUnitCache.loadUnitMap(PersistentUnitCache.java:566)
    at com.google.gwt.dev.javac.PersistentUnitCache.access$800(PersistentUnitCache.java:103)
    at com.google.gwt.dev.javac.PersistentUnitCache$4.run(PersistentUnitCache.java:232)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied ("java.io.FilePermission" "E:\java\mahlzeit-web\mahlzeit-web\src\com\mahlzeit\web\client\service\LoginServiceAsync.java" "read")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkRead(Unknown Source)
    at java.io.File.lastModified(Unknown Source)
    at com.google.gwt.dev.resource.impl.FileResource.getLastModified(FileResource.java:46)
    at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:552)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
    at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
    at com.google.gwt.dev.codeserver.Recompiler.initWithoutPrecompile(Recompiler.java:200)
    at com.google.gwt.dev.codeserver.Outbox.maybePrecompile(Outbox.java:82)
    at com.google.gwt.dev.codeserver.Outbox.<init>(Outbox.java:61)
    at com.google.gwt.dev.codeserver.CodeServer.makeOutboxes(CodeServer.java:156)
    at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:118)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:91)
    at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.SuperDevListener$1.run(SuperDevListener.java:84)
[ERROR] Error during shutdown
java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.io.FilePermission" "E:\java\mahlzeit-web\mahlzeit-web\gwt-unitCache\gwt-unitCache-c04dfa348afbdd12c2a9ddc3bc36901a78fa6812-0000014DD075526C" "delete")
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at com.google.gwt.dev.javac.PersistentUnitCache$5.run(PersistentUnitCache.java:301)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "E:\java\mahlzeit-web\mahlzeit-web\gwt-unitCache\gwt-unitCache-c04dfa348afbdd12c2a9ddc3bc36901a78fa6812-0000014DD075526C" "delete")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkDelete(Unknown Source)
    at java.io.File.delete(Unknown Source)
    at com.google.gwt.dev.javac.PersistentUnitCache.closeCurrentCacheFile(PersistentUnitCache.java:540)
    at com.google.gwt.dev.javac.PersistentUnitCache.access$700(PersistentUnitCache.java:103)
    at com.google.gwt.dev.javac.PersistentUnitCache$3.run(PersistentUnitCache.java:218)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-4" java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThread")
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.checkShutdownAccess(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.shutdownNow(Unknown Source)
    at java.util.concurrent.Executors$DelegatedExecutorService.shutdownNow(Unknown Source)
    at com.google.gwt.dev.javac.PersistentUnitCache$5.run(PersistentUnitCache.java:311)

每个人都知道Windows的工作方式鼓励程序将他们转移到一个所谓的临时目录中,你可以在C:\Users\<username>\AppData\Local\Temp\下找到并且已经创建但是从来没有试图避免只是为了惹恼 - 用户。我不知道为什么这是一个突然出现的问题 - 当然这是我的错,因为一定是我改变了一些东西 - 但我无法弄明白什么我改变了这个问题现在出现了。

使用默认问候语示例创建一个新的GWT项目可以毫无困难地运行 - 在Super Dev Mode&amp;在经典开发模式中。

它对我有什么要求?

作为旁注:自从我开始使用GWT以来,我正在从一个问题运行到另一个问题。我不记得GWT是如此痛苦的资产,但我一直认为这个工具只是讨厌我的次数太高了。所以,如果有人想要给我提示,请继续。我想要的只是一个相当简单的Web界面,允许登录用户操作数据库中的某些数据 - 但当然给它一些结构。

2 个答案:

答案 0 :(得分:2)

此例外的一个可能原因是,您正在使用Google App Engine并为您的项目添加了服务器端库。

要解决此问题:请停用Google App Engine或删除服务器端库。

看看这里: http://www.gwtproject.org/doc/latest/FAQ_Troubleshooting.html#AccessControlException_access_denied

希望有所帮助。

答案 1 :(得分:0)

我在你的堆栈跟踪中看到你有两个非常不同的路径有问题。 C:上的那个:E:\ java \ mahlzeit上的另一个....你的项目有可能在某处硬编码吗?在项目中搜索该字符串并将其更改为您需要的任何字符串。

我(现在)注意到的另一件事是底部还有另一个问题,即modifyThread策略。也许当您创建Hello World项目时,它默认为一个运行时环境,而您当前的项目正在使用另一个具有特殊策略设置的项目。