Struts2应用发布的时候注意把开发模式改回FALSE

   www.jhost.cn注册了一个帐号,可以免费使用jsp服务器,支持struts2+hirbernate+spring. 还有免费的sql服务器。 是个不错的免费空间。不过免费还是有限制的。最近好像还开始收费了。

    恩,在空间上发布了一个测试struts2的项目,结果弄了几天,没成功过。郁闷,服务器日志老是出错如下:严重: Exception starting filter struts2
java.security.AccessControlException: access denied (java.io.FilePermission jar:file:\D:\Apache2.2\htdocs\userspace\kaibing\wwwroot\WEB-INF\lib\struts2-core-2.1.8.1.jar read)
 at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
 at java.security.AccessController.checkPermission(AccessController.java:546)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
 at java.util.zip.ZipFile.<init>(ZipFile.java:109)
 at java.util.jar.JarFile.<init>(JarFile.java:133)
 at java.util.jar.JarFile.<init>(JarFile.java:70)
 at com.opensymphony.xwork2.util.FileManager$JarEntryRevision.needsReloading(FileManager.java:264)
 at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:70)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:324)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)
 at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
 at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:819)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
 at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1173)
 at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:623)
 at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:163)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at sun.reflect.GeneratedMethodAccessor1388.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
 at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
 at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
 at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
 at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
 at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
 at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
 at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
 at java.lang.Thread.run(Thread.java:619)
2010-1-23 0:01:39 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2010-1-23 0:01:39 org.apache.catalina.core.StandardContext start
严重: Context [/kaibing] startup failed due to previous errors
2010-1-23 0:01:39 freemarker.log.JDK14LoggerFactory$JDK14Logger warn
警告: Could not create a file template loader for current directory
java.security.AccessControlException: access denied (java.io.FilePermission D:\workspace\runexe read) 

 

就这么个简单的都弄不成,我晕。找了很多网页,问了很多人都不成。最后自己把struts.xml配置文件改了就成了。郁闷。

<constant name="struts.devMode" value="false" />   <!-- 设置开发模式打开 -->  关键是这个要改成false

然后就顺利成功了。

以下是我注册的网址:http://do.jhost.cn/kai  (随时更新,欢迎来访)

你可能感兴趣的:(java,apache,应用服务器,struts,Security)