Tonight, a few errors, after Baidu + Google + analysis, the correct solution, posted out for other people to refer to PS: waste in these errors-solve the wrong time a lot of Satan, Java Cheng hurt Oh .../-|-\
Preparatory work:
Copy the Strus2+json Integrated jar package to the/project name/webroot/web-inf/lib , such as:
Before running well, moving the code will come up with so many errors, as follows:
1. Dispatcher initialization failed.
Unable to load configuration. -Package-jar:file:/d:/tomcatserver7.0.39/apache-tomcat-7.0.39/webapps/bishe/web-inf/lib/struts2-json-1. plugin-2.3.8.jar!/struts-plugin.xml:8:59
---------------------------------------Reference Blog http://blog.sina.com.cn/s/blog_6f45626b010168hl.html
caused by:the package name ' Json-default ' at Location package-jar:file:/d:/software/jboss-4.2.2.ga/server/default/deploy/order.war/web-inf/lib/ Struts2-json-plugin-2.2.1.1.jar!/struts-plugin.xml:8:59 is already been used by another package at location Package-jar: file:/d:/software/jboss-4.2.2.ga/server/default/deploy/order.war/web-inf/lib/jsonplugin-0.34.jar!/ struts-plugin.xml:8:59-package-jar:file:/d:/software/jboss-4.2.2.ga/server/default/deploy/order.war/web-inf/ lib/struts2-json-plugin-2.2.1.1.jar!/struts-plugin.xml:8:59
The cause is probably the war file or There are duplicate Plugin.jar packages in the deployment , there are duplicates removed, if the check is not repeated there is still a problem, remove the already deployed projects, restart Tomcat or JBoss server redeployment instead of redeploy, eventually resolve the issue.
--------------------------------------------
originally all of my jar package is have these two jar package, see above blog said, estimate is these two duplicates, all deleted the first Strust2-json-plugin-2.3.8.jar retains the second Json-lib-2.3-jdk15.jar. OK, this error has been solved! But the 2nd error pops up as follows:
2. Org.apache.catalina.loader.WebappClassLoader Checkthreadlocalmapforleaks
Critical: The Web application [/bishe] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.containerimpl$10] (Value [[email protected]]) and a value of type [java.lang.object[]] (value [[Ljava.lang.Object; @cbf8b7]) but failed to re Move it when the Web application was stopped. Threads is going to being renewed over time to try and avoid a probable memory leak.
--------look at such a large string of English, it should be memory leaks and so on ...
Think of the previously changed code: " in action with request to receive the foreground parameters, red box code must have Ah, is careless forget to implement Servletrequestaware, so caused the above error "
Struts2+json a few mistakes