java.lang.NoSuchMethodException: org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPictureBaseImpl错误
2018-05-28 18:36:23
3102次阅读
0个评论
使用poi对office文档进行操作的时候,出现以下异常
java.lang.NoSuchMethodException: org.openxmlformats.schemas.wordprocessingml.x2006.main.impl.CTPictureBaseImpl.<init>(org.apache.xmlbeans.SchemaType, boolean)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.getJavaImplConstructor2(SchemaTypeImpl.java:1817)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedSubclass(SchemaTypeImpl.java:1961)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1950)
at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:1051)
at org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:938)
at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1675)
at org.apache.xmlbeans.impl.store.Cur.getUser(Cur.java:2659)
at org.apache.xmlbeans.impl.store.Cur.getObject(Cur.java:2652)
at org.apache.xmlbeans.impl.store.Cursor._getObject(Cursor.java:995)
at org.apache.xmlbeans.impl.store.Cursor.getObject(Cursor.java:2904)
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:162)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:169)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:119)
at search.utils.POI.readWord(POI.java:169)
at search.service.ThreadManage.executive(ThreadManage.java:115)
at search.service.ThreadManage.run(ThreadManage.java:214)
at java.lang.Thread.run(Unknown Source)
实际在项目中已经引入poi-ooxml-schemas-3.17.jar这个包,但是却一直报找不到类的异常。然后查poi官网资料(http://poi.apache.org/faq.html)得知poi提供的那个poi-ooxml-schemas-3.17.jar包是精简版的,为了节省空间,里面放的只有一些常用的模块,所以要引用另外一些功能的话就需要引用完整版的ooxml-schemas.jar包。另外,POI 3.14以上版本对应的完整版的jar包是ooxml-schemas-1.3.jar,这样导入之后果然就好了。
00
相关话题
- java.lang.ClassNotFoundException: javax.xml.bind.JAXBException错误
- 解决:Plugin org.apache.maven.plugins:maven-resources-plugin:2.6错误
- Thumbnailator处理gif图片时java.lang.ArrayIndexOutOfBoundsException: 4096异常
- lucene (Too many open files)错误
- commons-lang3提示“The type StringEscapeUtils is deprecated”
- Nginx 设置 X-Accel-Redirect 控制文件下载
- Java排序算法
- FFmpeg每隔X秒创建一个缩略图
- Nginx 上传文件出现413 Request Entity Too Large错误
- Java制作字符动画
- Java执行Javascript代码
- CentOS 8.x系统停止维护yum无法使用解决方法
- 解决一个意外错误使您无法删除该文件
- JAVA 原生异步执行方法CompletableFuture
- Java中文算数验证码