严重: /jsPage/test java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.jfinal.aop.Invocation.invoke(Invocation.java:87) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74) at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:74) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.jfinal.aop.Invocation.invoke(Invocation.java:73) ... 19 more Caused by: java.lang.NoClassDefFoundError: com/oreilly/servlet/multipart/FileRenamePolicy at com.jfinal.core.Controller.getFiles(Controller.java:763) at com.jfinal.core.Controller.getFile(Controller.java:768) at cn.edu.dlmu.wechat.controller.WeixinJSSdkPageController.test(WeixinJSSdkPageController.java:53) ... 24 more Caused by: java.lang.ClassNotFoundException: com.oreilly.servlet.multipart.FileRenamePolicy at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) ... 27 more 是maven创建的项目 看过社区的一些反馈文章之后,自己也进行了相应的配置 第一是尝试了: <!-- https://mvnrepository.com/artifact/servlets.com/cos --> <dependency> <groupId>servlets.com</groupId> <artifactId>cos</artifactId> <version>05Nov2002</version> </dependency> 不行,还是报上面的错误。 第二尝试了: <!-- https://mvnrepository.com/artifact/com.jfinal/cos --> <dependency> <groupId>com.jfinal</groupId> <artifactId>cos</artifactId> <version>2017.5</version> </dependency> 也是不行,错误一样,看见网上好多都说是缺少cos.jar,自己也用maven引入了,还有就是之前看到一个
人说收到导入com.oreilly.servlet.multipart.FileRenamePolicy,但是我的不行,没有oreilly,波总可以帮忙解决一下,在线等
NoClassDefFoundError 这个异常表明,就是有老版本干扰了新版本。
特别注意:NoClassDefFoundError 与 ClassNotFound 这两个异常是两回事, 前者是包版本不对或者不同版本包干扰, 后者是包未找到