aused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible min

摘要:
版权声明:转载请注明出处https://blog.csdn.net/seashouwang/article/details/240258716.导入Word2007 docx和Excel-2007-xlsx时出错〔2014-04-1809:39:14.195〕-〔Error〕org.apache.struts2.dispatcher.DispatcherExceptionoccurrenceduring
版权声明:转载请注明出处 https://blog.csdn.net/seashouwang/article/details/24025871
6.导入Word2007-docx,Excel-2007-xlsx出现错误
[2014-04-18 09:39:14.195]-[ERROR] org.apache.struts2.dispatcher.Dispatcher Exception occurred during processing request: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.get(Field.java:358)
at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770)
at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument.<clinit>(Unknown Source)
at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source)
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:134)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:159)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:116)
at org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:53)
at com.eshore.govwb.web.util.FileUtil.readWord2007(FileUtil.java:602)
at com.eshore.govwb.web.demo.LucenesAction.upload(LucenesAction.java:295)
... 71 more
Caused by: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct?
at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.loadTypeSystem(Unknown Source)
at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.<clinit>(Unknown Source)
... 86 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
... 88 more
Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 3
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.<init>(SchemaTypeSystemImpl.java:1522)
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:260)
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.<init>(SchemaTypeSystemImpl.java:183)
... 92 more




问题描写叙述:在excel,word文件上传时,Word2007-docx,Excel-2007-xlsx出现错误,主要原因是由于在使用xmlBeans.jar冲突的问题或者是版本号太低。
改动方法:将项目中使用的xbeans-2.0.jar,xmlbeans2.3.jar低版本号删除,使用了一个xmlbeans-2.4.jar问题就攻克了。


參考:http://markmail.org/message/ccydmwwpr6vyy7cp
http://stackoverflow.com/questions/1180776/runtimeexception-from-xmlbeans-cant-find-compiled-schema
http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200910.mbox/<c9de60ec-4bb3-45c1-9fbf-a7d89c95c602@default>
excel2007读取方法參考:http://www.iteye.com/problems/55196
word读取方法參考:http://blog.csdn.net/xingyunpi/article/details/6896638

http://blog.sina.com.cn/s/blog_6c7f7b690100lh8y.html

资源有本人上传的源代码,希望对在实现该功能的朋友给予小小帮助。




免责声明:文章转载自《aused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible min》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇IDEA 中 30 秒生成 Spring Cloud Alibaba 工程1.MyBatis所需要的配置文件下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

ModSecurity学习笔记(一)

ModSecurity安装可参考中文社区中 CentOS下Apache+ModSecurity(2.9.3)安装教程及配置WAF规则文件 步骤非常详细,并且提供了软件包合集,适合新手操作。 但是文章后面涉及到规则库zip文件的解压缩等操作没有提供命令,个人单独整理了下: #owasp-modsecurity-crs-3.3-dev.zip解压缩 cd /u...

POI导出数据内存溢出问题

POI之前的版本不支持大数据量处理,如果数据过多则经常报OOM错误,有时候调整JVM大小效果也不是太好。3.8版本的POI新出来了SXSSFWorkbook,可以支持大数据量的操作,只是SXSSFWorkbook只支持.xlsx格式,不支持.xls格式。 3.8版本的POI对excel的导出操作,一般只使用HSSFWorkbook以及SXSSFWorkb...

svn_linux + apache 实现网页访问svn

CentOS7:搭建SVN + Apache 服务器实现网页访问 1. 安装httpd 安装httpd服务: $ sudo yum install httpd 检查httpd是否安装成功: $ httpd -version Server version: Apache/2.4.6 (CentOS) Server built: Jul 18 20...

java调用ip138实现ip地址查询

HttpClient不是一个浏览器,而是一个客户端HTTP传输类库。HttpClient作用是传输和接收HTTP消息。在HttpClient模块中用到了两个重要的类:HttpGet和HttpPost。这两个类分别用来提交HTTPGET和HTTPPOST请求。 接下来我们将使用以上的理论作为基础,然后进行一次连接http://www.ip138.com/ip...

Vue项目上线后刷新报错404问题(apache,nginx,tomcat)

一、 Vue项目打包发布apache报错: route,配置一个覆盖所有的路由情况 1、需要修改router/index.js中new Router 配置,加一个base: '/htcm_front/', 它指定应用的基路径,该应用是服务于localhost/htcm_front路径下,所以必须加base配置,否则应用会展示404页面 2、需要修改conf...

解决catalina.out文件过大的方法

转载:https://www.cnblogs.com/zhm1985/articles/12145792.html 用Tomcat的人,绝对都会遇到这样一个问题:catalina.out文件过大。 它是Tomcat默认生成的日志文件,会随着时间的推移,逐渐增大,不断的增长,甚至达到几G,几十G的大小。由于文件过大,不仅占系统的存储,我们还将无法使用过常规的...