2011-3-28 21:28:29 org.apache.catalina.core.StandardContext filterStart 严重:

初次接触Structs2,学习马士兵Structs2例子报错:
如果含有:<constant name="struts.devMode" value="true"/> 或者
<constant name="struts.configuration.xml.reload" value="true"/>
现在你的struts.xml里面看看,肯定有这样的代码....如果有就继续往下看吧.....
       
  
011-3-28 21:28:28 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.i18n.reload - old value: false new value: true
2011-3-28 21:28:28 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.configuration.xml.reload - old value: false new value: true
2011-3-28 21:28:29 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.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)
    

devMode模式是开发模式,开启它则默认开启了i18n.reload、configuration.xml.reload。这个错误是由于configuration.xml.reload设置为true导致的, 原因很简单,tomcat的安装路径包含空格.....
  把tomcat安装目录里的 空格删了就行了......试试吧...很简单的...
再 把 myEclipse的工作区间 的 空格 去了....都不要  空格
把那两个冲突的东西都注释掉...i18n.reload、configuration.xml.reload...注释...

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