java.lang.ClassNotFoundException: org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPIm

使用poi对office文档进行操作,调用CTP.getBookmarkStartList()的时,出现了异常如下:

Exception in thread “main” java.lang.NoClassDefFoundError: org/openxmlformats/schemas/wordprocessingml/x2006/main/impl/CTPImpl1BookmarkStartListatorg.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPImpl.getBookmarkStartList(UnknownSource)atpac.ReportGenerator.handleParagraph(ReportGenerator.java:152)atpac.ReportGenerator.getUniqueData(ReportGenerator.java:129)atpac.ReportGenerator.main(ReportGenerator.java:62)Causedby:java.lang.ClassNotFoundException:org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPImpl1BookmarkStartList 
at java.net.URLClassLoader1.run(UnknownSource)atjava.net.URLClassLoader1.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)

    根据官网说明,poi-ooxml-schemas.jar包是精简版的,为了节省空间,里面放的只有一些常用的模块,所以要引用另外一些功能的话就需要引用完全版的ooxml-schemas.jar包。另外,3.5和3.6版本的poi对应的完整版的jar包是1.0版,如果要用3.7及以上的,就需要用ooxml-schemas-1.1.jar包。

引用地址:http://blog.csdn.net/lex1993/article/details/47062141?_t_t_t=0.5151249794266717

发帖时间: POI

发表评论

电子邮件地址不会被公开。 必填项已用*标注