List转换成JSON对象
1、具体报错如下
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at net.sf.json.AbstractJSON.<clinit>(AbstractJSON.java:54)
at com.you.file.upload.util.ListToJSON.main(ListToJSON.java:48)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
2、错误原因
lib目录下未导入commons-logging-1.1.3.jar
3、解决办法
在WEB-INF下的lib目录中导入commons-logging-1.1.3.jar