我正在尝试使用poi-3.10-FINAL-20140208.jar读取.xlsx文件,并将其所有依赖项添加到classpath&运行时(EAR / WAR / lib的一部分)但仍然出现以下异常。 EAR包括罐子:
poi-3.10-FINAL-20140208.jar
poi-ooxml-3.10-FINAL-20140208.jar
poi-ooxml-schemas-3.10-FINAL-20140208.jar
poi-scratchpad-3.10-FINAL-20140208.jar
commons-codec-1.5.jar
commons-logging-1.1.jar
junit-4.11.jar
log4j-1.2.13.jar
stax-api-1.0.1.jar
xmlbeans-2.3.0.jar
我能够通过使用相同的罐子成功读取.xls。
有人可以帮帮我吗?
Stacktrace:
2014-05-22 11:32:22,050 ERROR [STDERR] (ajp-10.21.14.8-8509-13) org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:426)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:155)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:221)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at com.xxxxxx.util.xxxFileUtils.readXlsxFile(xxxxxFileUtils.java:144)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at com.xxxxxxxx.xxxx.xxxxx.services.xxxxxxxx.xxxxxxxxxx(xxxxxxxxxx.java:515)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.lang.reflect.Method.invoke(Method.java:622)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.util.concurrent.FutureTask.run(FutureTask.java:166)
2014-05-22 11:32:22,051 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:126)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:164)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
2014-05-22 11:32:22,052 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.lang.Thread.run(Thread.java:701)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) Caused by: java.lang.reflect.InvocationTargetException
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2014-05-22 11:32:22,053 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) ... 55 more
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown Source)
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) at org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:44)
2014-05-22 11:32:22,054 ERROR [STDERR] (ajp-10.21.14.8-8509-13) ... 60 more