Recently, when I was studying struts2, I was always unable to start the Tomcat server. The following error is reported: 6.0 and 7.0 are not supported. At first, I thought it was an environment problem and I had to leave it all afternoon. The strtus jar I used is 2.16, but it is still good to work on the project a few days ago. However, the following error is always reported when I switch to another workspace, which is very annoying. After switching online for a long time, he tried many of his methods to solve the problem.
1. strtus. xml
Configured in struts. xml<Constant name = "struts. devmode "value =" true "/> (it is said that <constant name =" struts. configuration. XML. reload "value =" true "/> also reports an error. I have not tried this)
When Tomcat is started, an error is reported.
Org. Apache. Catalina. Core. standardcontext filterstart
Severe: 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. filterdispatcher. INIT (filterdispatcher. Java: 191)
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: 3709)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4363)
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: 525)
At org. Apache. Catalina. startup. hostconfig. deploydirectory (hostconfig. Java: 926)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 889)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 492)
At org. Apache. Catalina. startup. hostconfig. Start (hostconfig. Java: 1149)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 311)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 117)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1053)
At org. Apache. Catalina. Core. standardhost. Start (standardhost. Java: 719)
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: 578)
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: 288)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 413)
22:40:54 org. Apache. Catalina. Core. standardcontext start
Severe: Error filterstart
22:40:54 org. Apache. Catalina. Core. standardcontext start
Severe: context [/struts2demo2] startup failed due to previous errors
Solution on the Internet: devmode is the development mode, and it is enabled by default.
I18n. Reload,
Configuration. xml. Reload. This error occurs because configuration. xml. Reload is set to true,
The document does not explain the cause and solution, but someone on a foreign Apache BBS said this was a bug of version 216, and attached a. Patch correction file, saying version 217
Will be corrected... But I won't use it, and I don't know if it is the cause. This problem has been put on hold. After a few months, I recently checked a list of emails sent to Apache.
The reason for this is that the installation path of Tomcat contains spaces... Speechless... This is true for a try.
My success method: It is said that this is a bug in struts2.1.6. If it is changed to version 2.1.8, it will be OK. Of course, the corresponding xwork version will also be required, as if it was xwork2.1.6, I changed the old jar package to the new one.
Note: An error may occur when you restart tomcat after two jar packages are changed,Unable to load Bean: Type: Class: COM. opensymphony. xwork2.objectfactory-bean-jar. This error occurs at the beginning. If you delete the corresponding project in Tomcat, it will be okay if you redeploy it.
Below is an overview of the four common development patterns --- (from the http://hi.baidu.com/12261016/blog/item/1d7f6ccaded7248ec91768ec.html)
-->
-->
-->
-->