Алибаба easyexcel jar внутри импортировала класс poi jar, но у внешнего есть один poi jar, который может конфликтовать с easyexcel - PullRequest
0 голосов
/ 15 марта 2019

Сначала вот код исключения

java.lang.ClassNotFoundException: org.apache.poi.xssf.streaming.SXSSFWorkbook
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at com.alibaba.excel.context.GenerateContextImpl.<init>(GenerateContextImpl.java:64)
    at com.alibaba.excel.write.ExcelBuilderImpl.init(ExcelBuilderImpl.java:35)
    at com.alibaba.excel.ExcelWriter.<init>(ExcelWriter.java:50)
    at com.landray.kmss.km.archive.excel.DownloadServlet.doGet(DownloadServlet.java:81)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:143)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:177)
    at com.landray.kmss.third.pda.interfaces.ThirdPdaRedirectFilter.doFilter(ThirdPdaRedirectFilter.java:103)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at com.landray.kmss.sys.admin.threadmonitor.service.spring.SysAdminThreadMonitorFilter.doFilter(SysAdminThreadMonitorFilter.java:54)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy.doFilter(KmssProcessingFilterProxy.java:55)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at com.landray.kmss.sys.authentication.integration.CheckVerificationCodeFilter.doFilter(CheckVerificationCodeFilter.java:115)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
    at com.landray.kmss.web.filter.AcegiFilterToBeanProxy.doFilter(AcegiFilterToBeanProxy.java:37)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.landray.kmss.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
2019-03-15 10:17:25,643 [ERROR] ==== http-8080-4: com.landray.kmss.util.KmssMessageWriter.logError(208)
    很抱歉,操作失败!,URL=http://localhost:8080/ekp/resource/jsp/jsperror.jsp?type=500

java.lang.NoClassDefFoundError: org/apache/poi/xssf/streaming/SXSSFWorkbook
    at com.alibaba.excel.context.GenerateContextImpl.<init>(GenerateContextImpl.java:64)
    at com.alibaba.excel.write.ExcelBuilderImpl.init(ExcelBuilderImpl.java:35)
    at com.alibaba.excel.ExcelWriter.<init>(ExcelWriter.java:50)
    at com.landray.kmss.km.archive.excel.DownloadServlet.doGet(DownloadServlet.java:81)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:143)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:177)
    at com.landray.kmss.third.pda.interfaces.ThirdPdaRedirectFilter.doFilter(ThirdPdaRedirectFilter.java:103)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at com.landray.kmss.sys.admin.threadmonitor.service.spring.SysAdminThreadMonitorFilter.doFilter(SysAdminThreadMonitorFilter.java:54)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy$VirtualFilterChain.doFilter(KmssProcessingFilterProxy.java:183)
    at com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy.doFilter(KmssProcessingFilterProxy.java:55)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at com.landray.kmss.sys.authentication.integration.CheckVerificationCodeFilter.doFilter(CheckVerificationCodeFilter.java:115)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
    at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
    at com.landray.kmss.web.filter.AcegiFilterToBeanProxy.doFilter(AcegiFilterToBeanProxy.java:37)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.landray.kmss.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.streaming.SXSSFWorkbook
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    ... 50 more

Я могу искать класс org.apache.poi.xssf.streaming.SXSSFWorkbook в проекте, используя Ctrl + Shift + T, но я вижу только один класс. IХава попробовал это с IntelliJ IDEA чисто, и я могу получить правильную вещь, как я и ожидал. Но когда я делаю код и банку в моем официальном рабочем пространстве, где есть так много других банок, я думаю, что две банки конфликтуют друг с другом,Вот мои картинки.

https://img.shownmmp.top/easyexcel.png
https://img.shownmmp.top/poi.png

Буду признателен за любую помощь.

1 Ответ

0 голосов
/ 15 марта 2019

Попробуйте использовать Maven или любой другой инструмент сборки, в котором вы можете легко контролировать, какие зависимости используются и добавляются в результирующий артефакт. Также с Maven вы можете явно исключить конфликтующие переходные зависимости.

...