weblogic 12c下jxls导出excel报错Could not initialize class org.apache.poi.xssf.usermodel.XSSFVMLDrawing
Posted 太白的技术博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了weblogic 12c下jxls导出excel报错Could not initialize class org.apache.poi.xssf.usermodel.XSSFVMLDrawing相关的知识,希望对你有一定的参考价值。
周一,开发反馈weblogic 12c下jxls导出excel报错,公司环境和UAT环境均报错,看日志如下:
2016-06-08 09:16:55,825 ERROR org.jxls.util.TransformerFactory.createTransformer(TransformerFactory.java:40)[org.jxls.util.TransformerFactory] - Method createTransformer of org.jxls.transform.poi.PoiTransformer class thrown an Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jxls.util.TransformerFactory.createTransformer(TransformerFactory.java:35)
at org.jxls.util.JxlsHelper.createTransformer(JxlsHelper.java:198)
at org.jxls.util.JxlsHelper.processTemplate(JxlsHelper.java:93)
at com.ccps.info.logic.common.ExportTool.exportTool(ExportTool.java:30)
at com.ccps.info.logic.CenterDailySettlementLogicImpl.centerDailySettlement(CenterDailySettlementLogicImpl.java:39)
at com.ccps.info.service.CenterDailySettlementServiceImpl.centerDailySettlement(CenterDailySettlementServiceImpl.java:32)
at com.ccps.info.as.InfoT2ServiceImpl.centerDailySettlement(InfoT2ServiceImpl.java:189)
at com.ccps.info.as.InfoT2ServiceImpl$$FastClassByCGLIB$$1e6a83ef.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at com.ccps.info.as.InfoT2ServiceImpl$$EnhancerByCGLIB$$96b903c0.centerDailySettlement(<generated>)
at sun.reflect.GeneratedMethodAccessor784.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.hundsun.jresplus.remoting.impl.DefaultServiceProcessor.execute(DefaultServiceProcessor.java:66)
at com.hundsun.jresplus.remoting.server.ServiceSkeleton.excute(ServiceSkeleton.java:102)
at com.hundsun.jresplus.remoting.plugin.BizService.execute(BizService.java:139)
at com.hundsun.jres.impl.cep.bizmodule.BizModule$Processer.run(BizModule.java:483)
at com.hundsun.jres.common.cep.pool.RestlessThread.run(RestlessThread.java:143)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.usermodel.XSSFVMLDrawing
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:403)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:408)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:186)
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:73)
at org.jxls.transform.poi.PoiTransformer.createTransformer(PoiTransformer.java:47)
at org.jxls.transform.poi.PoiTransformer.createTransformer(PoiTransformer.java:40)
... 29 more
2016-06-08 09:16:55,826 ERROR com.ccps.info.logic.common.ExportTool.exportTool(ExportTool.java:33)[com.ccps.info.logic.common.ExportTool] -
java.lang.IllegalStateException: Cannot load XLS transformer. Please make sure a Transformer implementation is in classpath
at org.jxls.util.JxlsHelper.createTransformer(JxlsHelper.java:200)
at org.jxls.util.JxlsHelper.processTemplate(JxlsHelper.java:93)
at com.ccps.info.logic.common.ExportTool.exportTool(ExportTool.java:30)
at com.ccps.info.logic.CenterDailySettlementLogicImpl.centerDailySettlement(CenterDailySettlementLogicImpl.java:39)
at com.ccps.info.service.CenterDailySettlementServiceImpl.centerDailySettlement(CenterDailySettlementServiceImpl.java:32)
at com.ccps.info.as.InfoT2ServiceImpl.centerDailySettlement(InfoT2ServiceImpl.java:189)
at com.ccps.info.as.InfoT2ServiceImpl$$FastClassByCGLIB$$1e6a83ef.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at com.ccps.info.as.InfoT2ServiceImpl$$EnhancerByCGLIB$$96b903c0.centerDailySettlement(<generated>)
at sun.reflect.GeneratedMethodAccessor784.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.hundsun.jresplus.remoting.impl.DefaultServiceProcessor.execute(DefaultServiceProcessor.java:66)
at com.hundsun.jresplus.remoting.server.ServiceSkeleton.excute(ServiceSkeleton.java:102)
at com.hundsun.jresplus.remoting.plugin.BizService.execute(BizService.java:139)
at com.hundsun.jres.impl.cep.bizmodule.BizModule$Processer.run(BizModule.java:483)
at com.hundsun.jres.common.cep.pool.RestlessThread.run(RestlessThread.java:143)
======
后来又报了Caused By: java.lang.LinkageError: loader constraint violation: loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) previously initiated loading for a different type with name "javax/xml/namespace/QName"
经查,为javax/xml/namespace/QName冲突所致,weblogic下删除stax-api-1.0.1.jar的jar包即可。
以上是关于weblogic 12c下jxls导出excel报错Could not initialize class org.apache.poi.xssf.usermodel.XSSFVMLDrawing的主要内容,如果未能解决你的问题,请参考以下文章