java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.TextUtils

java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.TextUtils:

这是struts 的版本错误,因为用的 xwork2.1.6-core.jar 中不存在 TextUtils 类,这里把  xwork2.1.2-core.jar 也加到 classpath 中, xwork2.1.2-core.jar 中包含这个东西,我们用的是 xwork2.1.6 的 jar ,当要用到 TextUtils 时,就去 xwork2.1.2-core.jar 中找。

发现这样貌似也不行呀!!!

解决了,OK!!!!
原因:jsonplugin-0.34.jar 配合 struts2-core-2.1.8.1.jar 使用的情况下报的异常,但以前的项目中jsonplugin-0.34.jar 配合 struts2-core-2.1.6.jar 使用不会出现这样的异常

解决方法:去掉jsonplugin-0.34.jar,使用struts2-json-plugin-2.1.8.1.jar 和 json-lib-2.1.jar,struts2-junit-plugin-2.1.8.jar三个包

猜你喜欢

转载自lfq618.iteye.com/blog/1069500