java 操作excel文件 发布后报错

org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException

XSSFWorkbook xwb = new XSSFWorkbook(fileName);

这句报错

使用的poi版本 3.8

网上提供的解决方案很多,一一试下,也没有解决。

后经过各种调查后,终于找到了解决办法。

此问题的确是jar包冲突。

只需要将里面的引用的 xbean-2.2.0.jar删除

bweb\WEB-INF\lib\xbean-2.2.0.jar 此目录下的xbean-2.2.0.jar包删除 即可

错误详情

org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException

at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFact

ory.java:62)

at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:403)

at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)

at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:1

90)

at com.hp.bpdp.integrated.common.ExcelOperate.getData(ExcelOperate.java:

72)

at com.hp.bpdp.ass.service.impl.AssInfoSecurityTaskServiceImpl.antiFraud

Complaint(AssInfoSecurityTaskServiceImpl.java:2296)

at com.hp.bpdp.ass.service.impl.AssInfoSecurityTaskServiceImplFastClas

sBySpringCGLIBd7aa56ae.invoke()

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:2

04)

at org.springframework.aop.framework.CglibAopProxyCglibMethodInvocation

.invokeJoinpoint(CglibAopProxy.java:708)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(

ReflectiveMethodInvocation.java:157)

at org.springframework.transaction.interceptor.TransactionInterceptor1.

proceedWithInvocation(TransactionInterceptor.java:98)

at org.springframework.transaction.interceptor.TransactionAspectSupport.

invokeWithinTransaction(TransactionAspectSupport.java:262)

at org.springframework.transaction.interceptor.TransactionInterceptor.in

voke(TransactionInterceptor.java:95)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(

ReflectiveMethodInvocation.java:179)

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invok

e(ExposeInvocationInterceptor.java:92)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(

ReflectiveMethodInvocation.java:179)

at org.springframework.aop.framework.CglibAopProxyDynamicAdvisedInterce

ptor.intercept(CglibAopProxy.java:644)

at com.hp.bpdp.ass.service.impl.AssInfoSecurityTaskServiceImplEnhancer

BySpringCGLIB1ff8283d.antiFraudComplaint()

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.springframework.scheduling.support.ScheduledMethodRunnable.run(Sc

heduledMethodRunnable.java:65)

at org.springframework.scheduling.support.DelegatingErrorHandlingRunnabl

e.run(DelegatingErrorHandlingRunnable.java:54)

at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(Re

schedulingRunnable.java:81)

at java.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:47

1)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.

access201(ScheduledThreadPoolExecutor.java:178)

at java.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.

run(ScheduledThreadPoolExecutor.java:292)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.

java:1145)

at java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor

.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct

orAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC

onstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFact

ory.java:60)

... 31 more

Caused by: java.lang.ExceptionInInitializerError

at sun.misc.Unsafe.ensureClassInitialized(Native Method)

at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAc

cessorFactory.java:43)

at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java

:140)

at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1057)

at java.lang.reflect.Field.getFieldAccessor(Field.java:1038)

at java.lang.reflect.Field.get(Field.java:379)

at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:7

70)

at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument.<clinit

(Unknown Source)

at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory

.parse(Unknown Source)

at org.apache.poi.xssf.model.ThemesTable.(ThemesTable.java:44)

... 36 more

Caused by: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImp

l (java.lang.reflect.InvocationTargetException): is the version of xbean.jar cor

rect?

at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.Ty

peSystemHolder.loadTypeSystem(Unknown Source)

at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.Ty

peSystemHolder.(Unknown Source)

... 46 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct

orAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC

onstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

... 48 more

Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled sch

ema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_x

mlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 3

at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.

(SchemaTypeSystemImpl.java:1522)

at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(S

chemaTypeSystemImpl.java:260)

at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.(SchemaTyp

eSystemImpl.java:183)

Java 错误提示org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException的更多相关文章

  1. Java 读取Excel2007 jar包冲突的问题(org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException)

    1.jar包冲突报错问题 2.使用的jar包,以及重复jar包 3.删除重复jar包

  2. JAVA错误:org.apache.jasper.JasperException: java.lang.ClassCastException:org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apach

    解决方法一(一般情况加均可解决问题): 修改了tomcat里的context.xml文件,在context 元素下添加  <Loader delegate="true"/&g ...

  3. Error: Default interface methods are only supported starting with Android N (--min-api 24): java.io.InputStream org.apache.poi.sl.usermodel.ObjectShape.readObjectData()

    项目运行的时候,如果报错 Error: Default interface methods are only supported starting with Android N (--min-api ...

  4. 错误: java.lang.reflect.InvocationTargetException

    错误: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeMethodAccessorImpl.invoke0(N ...

  5. mavne install 报错org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException

    maven install 报错 org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.Invoc ...

  6. JAVA错误:Exception in thread "main" java.lang.NullPointerException

    JAVA错误:Exception in thread "main" java.lang.NullPointerException例如: Exception in thread &q ...

  7. 关于java.lang.reflect.InvocationTargetException(jar 包缺少或者冲突)的错误

    我在合肥那边运行了的是湖北石首市的项目没有错 可是回武汉之后 运行这个项目 点击这里的时候 就报错java.lang.reflect.InvocationTargetException   不是数据库 ...

  8. Weka java.lang.reflect.InvocationTargetException

    在用Weka导入数据的时候报 java.lang.reflect.InvocationTargetException 错误,Weka运行包没有给出详细的错误信息,无法查到. 直接调试Weka源码,发现 ...

  9. java.sql.Date赋值给了java.util.Date.转化成JSONArray时出错net.sf.json.JSONException: java.lang.reflect.InvocationTargetException

    net.sf.json.JSONException: java.lang.reflect.InvocationTargetExceptionat net.sf.json.JSONObject.defa ...

随机推荐

  1. thinkphp 操作xml格式

    前言:虽然xml的格式看起来跟html差不多,但是最近做项目由于用的是thinkphp5.0的版本,做的过程中还是遇到了一些问题.在这里做一下记录. 首先我们需要定义一个dom对象,我们都知道 php ...

  2. vue试题

    1.v-for可是实现数据遍历显示,不仅可以遍历数组,也可以遍历对象,还可以从数值中取值. 2.vue的生命周期钩子 1)实例,组件通过new Vue()创建出来之后会初始化事件和生命周期,然后就会执 ...

  3. MySQL 存储过程的变量

    MySQL  存储过程的变量 变量是一个命名数据对象,变量的值可以在存储过程执行期间更改.我们通常使用存储过程中的变量来保存直接/间接结果. 这些变量是存储过程的本地变量. 注意:变量必须先声明后,才 ...

  4. 20175317 MyCP(课下作业,必做)

    一.题目要求 编写MyCP.java 实现类似Linux下cp XXX1 XXX2的功能,要求MyCP支持两个参数: java MyCP -tx XXX1.txt XXX2.bin 用来把文本文件(内 ...

  5. Effective java 系列之更优雅的关闭资源-try-with-resources

    背景: 在Java编程过程中,如果打开了外部资源(文件.数据库连接.网络连接等),我们必须在这些外部资源使用完毕后,手动关闭它们.因为外部资源不由JVM管理,无法享用JVM的垃圾回收机制,如果我们不在 ...

  6. 使用npm私有服务器保存公司内部强业务类型组件(二):vue-webpack框架

    一套基于vue webpack element-ui的npm私有服务器开发组件框架 下载 在配置的有两个地方需要注意: 1:配置library library选项: 如果设置此选项,会将bundle导 ...

  7. 记一次oracle数据库复制过程

    记录一次自己数据库复制的过程(从公司测试环境复制到客户测试环境),主要是每次自己都会忘记,不如记录一下,方便自己以后找,因此,本篇内容不会很详细,主要是用于给我自己提醒,相对于一种记笔记的效果. cm ...

  8. Python —— 函数高级特性(切片、迭代、列表生成式、生成器、迭代器)

    一.切片(Slice) 在很多编程语言中,针对字符串提供了很多截取函数(i.e.  substring),目的就是对字符串切片.python中没有针对字符串的截取函数,需要通过“切片”来完成. 取一个 ...

  9. UML序列图参考资料

    UML各个图的说明:http://www.uml.org.cn/oobject/201509015.asp?artid=16901 UML类图的说明:https://www.cnblogs.com/a ...

  10. React文档(二十三)Web Components

    React和web components是为了解决不同问题而创立的.web components为可重用组件提供了健壮的封装,而React提供了声明式的库来保持DOM和数据同步.这两点是互相补充的.作 ...