cebuleo
2009-10-25 07:51
浏览 177
已采纳

我用的是struts-2-16最新版本,出现了这样的问题,怎样解决?严重: Exception starting filter struts2

我在启动Tomcat后,项目会报这样一个错:

2009-10-16 20:58:55 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.16.
2009-10-16 20:58:55 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2009-10-16 20:58:55 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2009-10-16 20:58:55 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2009-10-16 20:58:55 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1083 ms
2009-10-16 20:58:55 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-10-16 20:58:55 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.20
2009-10-16 20:58:57 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2009-10-16 20:58:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2009-10-16 20:58:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts.xml]
2009-10-16 20:58:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.i18n.reload - old value: false new value: true
2009-10-16 20:58:58 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Overriding property struts.configuration.xml.reload - old value: false new value: true
2009-10-16 20:58:59 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)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2009-10-16 20:58:59 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-10-16 20:58:59 org.apache.catalina.core.StandardContext start
严重: Context [/eeliang] startup failed due to previous errors
2009-10-16 20:59:00 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2009-10-16 20:59:00 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2009-10-16 20:59:00 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2009-10-16 20:59:00 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2009-10-16 20:59:00 org.apache.catalina.startup.Catalina start
信息: Server startup in 5003 ms


问题补充:
我按照你的做法将那个官方提供的例子(struts2-blank-2.1.6)减压后,新建一个工程,运行后还是有问题,还是报那个错误.
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • tengxg 2009-10-25 11:52
    已采纳

    应该是你建项目时,导入的包有问题,或者你的struts.cof.xml有问题,后者的可能性比较大。你可以试着这样来做,将你下载的struts-2.1.6解压开后,进入apps,将struts2-blank-2.1.6.war解压开,进去,这是个模板项目,你新建一个web项目,将WEB-INF目录下的lib下的jar包复制到你项目的lib下,再将WEB-INF下的web.xml也复制到相应的位置,还有src目录下的struts.xml也复制到自己项目的src下,将这两个配置文件裁剪成最简单的,试一试应该没问题

    打赏 评论
  • 当保安的程序员 2009-10-25 15:58

    嗯 tongkaiteng老兄说得很有道理 应该就是那样

    打赏 评论

相关推荐 更多相似问题