Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject

抛出的异常:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
at excel1.ReadExcel.testPoiExcel2007(ReadExcel.java:14)
at excel1.ReadExcel.main(ReadExcel.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 2 more

 

 

解决办法:

下载最新poi

http://mirrors.cnnic.cn/apache/poi/release/bin/poi-bin-3.9-20121203.zip

加入包

poi-3.9\ 所有jar包

poi-3.9\ooxml-lib下的:三个jar包

如下图所示:

 

 

你可能感兴趣的:(java,java异常解决备忘录)