前几天下载了struts-2.1.6,地址http://struts.apache.org/download.cgi#struts216
当运行下apps文件夹下面自带的例子时出现下面的异常。
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.PrepareOperations.createActionContext(PrepareOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
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:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
后来才知道是我taomcat的路径的问题(C:\Program Files\Apache Software Foundation\Tomcat 6.0),因为我是默认安装的tomcat,
在Tomcat 6.0中间有个空格。去除空格或重装一个都可以解决问题。我又下载了个tomcat,解压在D:\apache-tomcat-6.0.18下面,再运行struts-2.1.6/apps下面的例子就没有问题了。
分享到:
相关推荐
struts2官方自带的四个例子,本人亲自调通,并能运行,是学习的好材料!
struts2标签使用例子 struts2标签使用例子 struts2标签使用例子struts2标签使用例子
struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子struts2例子
struts2完整例子struts2完整例子struts2完整例子struts2完整例子struts2完整例子struts2完整例子
struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子struts例子
struts2简单例子,struts2实例开发
主要介绍了struts2的标签的详细使用例子说明
整理struts2国际化例子源码整理struts2国际化例子源码整理struts2国际化例子源码
试用于初学者使用,练习STRUTS2的小例子
自己写的 Struts 2源代码 例子(包括Struts2 标签)
struts2 例子 struts.xml基本配置 页面跳转
Struts2 tiles操作例子,附带demo代码
eclipse的,Struts2 环境的搭建及和HelloWorld,Struts2 环境的搭建及和HelloWorld,Struts2 环境的搭建及和HelloWorld,Struts2 环境的搭建及和HelloWorld,Struts2 环境的搭建及和HelloWorld,Struts2 环境的搭建...
struts2的一个简单小例子,模拟一个用户登陆的过程,如果用户名密码成功则跳转到main.jsp,否则跳转到登陆界面并显示提示信息。
struts2输入验证例子struts2输入验证例子struts2输入验证例子
struts2登录小例子
struts2的简单例子,适用于初学java的人
struts2 令牌使用例子 直接导入使用
根据wantedsheep提问做的一个struts2例子
使用myeclipse自身支持的struts2做的一个登陆成功或失败的例子