自己写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也有,可是一直报错
一看就是包冲突了,poi.jar<spanstyle="font-family:'MicrosoftYaHei',Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">atcn.nin._99cj.util.BatchAddUserAction.putIntoExcel(BatchAddUserAction.java:79)看这里调用的方法是不是都有看看你是不是少jar包了,你把所有的jar引用一下试试
怎么解决的
一样问题??
包冲突了,公司原来的lib里面有这个包,我没注意找到原因了
poi旧包与新包冲突
官方解释:
YoualmostcertainlyhaveanolderversionofApachePOIonyourclasspath.QuiteafewruntimesandotherpackageswillshipolderversionofApachePOI,sothisisaneasyproblemtohitwithoutyourrealising.Somewillshipjustoneoldjar,somemayshipafullsetofoldPOIjars.
Thebestwaytoidentifytheoffendingearlierjarfilesiswithafewlinesofjava.ThesewillloadaCorePOIclass,anOOXMLclassandaScratchpadclass,andreportwheretheyallcamefrom.
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。