struts2空指针异常

来源:互联网 发布:淘宝上的代练可信吗 编辑:程序博客网 时间:2024/04/30 01:12

转自:http://www.cxybl.com/html/struts/2012041521552.html

将struts2的struts.xml中constant name="struts.devMode" value="true"/ 设置为true时,启动tomcat出现以下问题: 空指针异常,strust2,at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) 设置为false时,启将struts2的struts.xml中<constant name="struts.devMode" value="true"/> 
设置为true时,启动tomcat出现以下问题:空指针异常,strust2,at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)

设置为false时,启动正常。

查了N久原因,原来是tomcat路径的问题。

tomcat 的解压路径中不能包含空格,刚开始我的路径是在D:\Program Files/;其中有空格。之后我把空格去掉,重新部署,问题解决。

建议在路径配置以及文件命名中尽量不要包含空格,以免出现一些稀奇古怪的错误。