严重: Exception starting filter struts2 的解决方案

作为一个 struts 初学者 今天遇到一个 小问题 并且已经解决  不过很愿意和大家分享一下小经验!  也作为我以后进步的点点标记!  呵呵
1. 当我在设置 开发模式属性值的时候 如下:
<constant name="struts.devMode" value="true"/> 或者
<constant name="struts.configuration.xml.reload" value="true"/>
现在你的struts.xml里面看看,肯定有这样的代码....如果有就继续往下看吧.....
2. 结果报出了以下错误:
2011-10-21 15:27:17 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.NullPointerException
at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)
at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)
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:774)
at org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(InitOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4405)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5037)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:570)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1010)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:933)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1267)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:328)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:308)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1043)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:289)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.startup.Catalina.start(Catalina.java:596)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
2011-10-21 15:27:17 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
2011-10-21 15:27:17 org.apache.catalina.core.StandardContext startInternal
严重: Context [/struts2.1.6] startup failed due to previous errors
2011-10-21 15:27:18 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/struts2.1.6] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@98d94]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@12e0415]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2011-10-21 15:27:18 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/struts2.1.6] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@e046e]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@45105c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2011-10-21 15:27:18 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-10-21 15:27:18 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2011-10-21 15:27:18 org.apache.catalina.startup.Catalina start
信息: Server startup in 3061 ms

3. 可是当我改回以前的属性值时 却没有报错!
4. 进过分析好查找文档 发现:devMode模式是开发模式,开启它则默认开启了i18n.reload、configuration.xml.reload。这个错误是由于configuration.xml.reload设置为true导致的, 原因很简单,tomcat的安装路径包含空格
5. 于是将 tomcat 连同 开发空间的路径都给去掉了空格!
  返现还有一点别的 也顺便引用一下:
再 把 myEclipse的工作区间 的 空格 去了....都不要  空格 
把那两个冲突的东西都注释掉...i18n.reload、configuration.xml.reload...注释...

你可能感兴趣的:(java,tomcat,xml,struts,MyEclipse)