appengine struts 2.3.4.1错误(struts试图重新加载服务器)

时间:2012-10-25 06:20:39

标签: google-app-engine struts2 file-permissions accesscontrolexception

我在struts 2.3.4.1 AppEngine 1.7.2(GAE)项目中遇到了这个问题。似乎struts正在尝试重新加载服务器,而appEngine禁止它。

我已经搜索了这个问题,但只发现struts2.1.6版本错误修复由struts2.1.6更改。

的web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<display-name>LifeMusic</display-name>

<filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>struts2</filter-name>
   <url-pattern>*.action</url-pattern>
</filter-mapping>   

<welcome-file-list>
    <welcome-file>home.jsp</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

WEB-INF / lib上的库:

  

appengine-api-1.0-sdk-1.7.2.1.jar
appengine-api-labs.jar
  appengine-api-labs-1.7.2.1.jar
appengine-endpoints.jar
  AppEngine上-jsr107cache-1.7.2.1.jar
  commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
  commons-lang3-3.1.jar
datanucleus-appengine-1.0.10.final.jar
  datanucleus-core-1.1.5.jar
datanucleus-jpa-1.1.5.jar
  freemarker-2.3.19.jar
geronimo-jpa_3.0_spec-1.1.1.jar
  geronimo-jta_1.1_spec-1.1.1.jar
gwt-servlet.jar
  javassist-3.11.0.GA.jar
jdo2-api-2.3-eb.jar
  jsr107cache-1.1.jar
log4j-1.2.15.jar
mail.jar
  ognl-3.0.5.jar
struts2-core-2.3.4.1.jar
  XWork的核 - 2.3.4.1.jar

stacktrace错误:

java.security.AccessControlException: access denied ("java.io.FilePermission" "jar:file:\G:\Proyectos\LifeMusic\war\WEB-INF\lib\struts2-core-2.3.4.1.jar" "read")<br/>
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)<br/>
at java.security.AccessController.checkPermission(AccessController.java:555)<br/>
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)<br/>
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:289)<br/>
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)<br/>
at java.util.zip.ZipFile.<init>(ZipFile.java:205)<br/>
at java.util.zip.ZipFile.<init>(ZipFile.java:144)<br/>
at java.util.jar.JarFile.<init>(JarFile.java:152)<br/>
at java.util.jar.JarFile.<init>(JarFile.java:89)<br/>
at com.opensymphony.xwork2.util.fs.JarEntryRevision.needsReloading(JarEntryRevision.java:36)<br/>
at com.opensymphony.xwork2.util.fs.DefaultFileManager.fileNeedsReloading(DefaultFileManager.java:68)<br/>
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:346)<br/>
at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:169)<br/>
at com.opensymphony.xwork2.config.ConfigurationManager.needReloadContainerProviders(ConfigurationManager.java:203)<br/>
at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:177)<br/>
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:72)<br/>
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:901)<br/>
at org.apache.struts2.dispatcher.ng.PrepareOperations.createActionContext(PrepareOperations.java:78)<br/>
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:78)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:110)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:61)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)<br/>
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<br/>
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)<br/>
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)<br/>
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)<br/>
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)<br/>
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)<br/>
at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:94)<br/>
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)<br/>
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:380)<br/>
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)<br/>
at org.mortbay.jetty.Server.handle(Server.java:326)<br/>
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)<br/>
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)<br/>
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)<br/>
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)<br/>
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)<br/>
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)<br/>
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)<br/>

2 个答案:

答案 0 :(得分:1)

在struts.properties中将此属性设置为false:

struts.configuration.xml.reload =假
struts.devMode = false
struts.i18n.reload =假

答案 1 :(得分:0)

给定的解决方案对我来说不起作用,而是我必须创建一个自定义插件来覆盖默认的FileManager和FileManagerFactory实现:https://stackoverflow.com/a/20458563/313113