【异常处理】java.lang.NoClassDefFoundError
Exception in thread"main" java.lang.NoClassDefFoundError:org/apache/commons/lang/exception/NestableRuntimeException
使用环境: 项目中转json ,报了这个异常。
看了下json需要的jar包,都导入了。
查找了下原因,发现commons-collections-3.X.jar 和 commons-lang3-3.X.jar冲突的问题。
用commons-lang 2.X 就可以了。
(下载地址:http://www.cr173.com/soft/64964.html )
补充 json需要用到的包:
json-lib-2.2.3-jdk15.jar
commons-beanutils-1.7.0.jar
commons-httpclient-3.1.jar
commons-lang-2.3.jar
commons-logging-1.1.1.jar
commons-collections-3.2.1.jar
ezmorph-1.0.3.jar
commons-beanutils-1.7.0.jar
commons-httpclient-3.1.jar
commons-lang-2.3.jar
commons-logging-1.1.1.jar
commons-collections-3.2.1.jar
ezmorph-1.0.3.jar
没有的话会出现的异常:
java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher
java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
本文来自博客园,作者:邓晓晖,转载请注明原文链接:https://www.cnblogs.com/isdxh/p/5504589.html