struts2+json
java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtils
java.lang.ClassNotFoundException: org.apache.commons.lang3.xwork.StringUtils
刚开始用的是struts2-json-plugin-2.1.8.1.jar,struts-2.3.3
改为struts2-json-plugin-2.2.3.jar就正常了,但后来测试别的项目又报同样的错。。
后来发现貌似struts2-json-plugin-2.2.3.jar需要org.apache.commons.lang.xwork.StringUtils,org.apache.commons.lang3.xwork.StringUtils两个类
需要导入两个版本的包:commons-lang-2.5.jar,commons-lang3-3.1.jar(其它版本应该只要有这上面两个类的就行)
只导一个包的话,会报找不到另一个包的StringUtils类
本文详细介绍了使用struts2+json插件时遇到的ClassNotFoundException错误问题,以及通过导入commons-lang和commons-lang3包解决该问题的过程。文章提供了具体的错误堆栈信息分析,帮助开发者理解问题原因并找到解决方案。
3220

被折叠的 条评论
为什么被折叠?



