项目中用poi,在导出的时候报错
自己写Demo的时候完全正常,但是在项目中应用的时候报错了
java.lang.NoSuchMethodError: org.apache.poi.util.POILogger.log(I[Ljava/lang/Object;)V
at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:443)
at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1441)
at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:212)
at cn.nin._99cj.util.BatchAddUserAction.putIntoExcel(BatchAddUserAction.java:79)
at cn.nin._99cj.util.BatchAddUserAction.execute(BatchAddUserAction.java:34)
at cn.netinnet.qdk.action.execute.CommonAction.NextActionOrForwardOrCommonactionExecute(Unknown Source)
at cn.netinnet.qdk.action.execute.TypeQuery.execute(Unknown Source)
at cn.netinnet.qdk.action.DoActionSeries.a(Unknown Source)
at cn.netinnet.qdk.action.DoActionSeries.beginToDo(Unknown Source)
at cn.netinnet.qdk.action.ActionFilter.doFilter(Unknown Source)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at cn.nin._99cj.filter.BackFilter.doFilter(BackFilter.java:89)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at cn.nin._99cj.filter.OrgFilter.doFilter(OrgFilter.java:73)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at com.netinnet.qdk.filter.OrgFilter.doFilter(Unknown Source)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at com.netinnet.qdk.filter.AuthFilter.doFilter(Unknown Source)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at cn.netinnet.qdk.action.RequestFilter.doFilter(Unknown Source)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at cn.nin._99cj_org.filter.SecondLevelDomainFilter.doFilter(SecondLevelDomainFilter.java:37)
at com.netinnet.qdk.filter.NFilterChain.doFilter(Unknown Source)
at com.netinnet.qdk.QDKFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2440)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2429)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:619)
用的poi3.13
请问该如何解决的,log4j也有,可是一直报错
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
找到原因了
poi旧包与新包冲突
官方解释:
You almost certainly have an older version of Apache POI on your classpath. Quite a few runtimes and other packages will ship older version of Apache POI, so this is an easy problem to hit without your realising. Some will ship just one old jar, some may ship a full set of old POI jars.
The best way to identify the offending earlier jar files is with a few lines of java. These will load a Core POI class, an OOXML class and a Scratchpad class, and report where they all came from.
包冲突了,公司原来的lib里面有这个包,我没注意
at cn.nin._99cj.util.BatchAddUserAction.putIntoExcel(BatchAddUserAction.java:79) 看这里调用的方法是不是都有
一看就是包冲突了,poi.jar