@JFinal 你好,想跟你请教个问题:
/**
* 配置路由
*/
@Override
public void configRoute(Routes me) {
AutoBindRoutes routes = new AutoBindRoutes();
routes.autoScan(true);
me.add(routes);
}
总是报错
严重: Exception starting filter jfinal
java.lang.NoClassDefFoundError: org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2479)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1294)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.jfinal.ext.kit.Reflect.forName(Reflect.java:692)
at com.jfinal.ext.kit.Reflect.on(Reflect.java:85)
at com.jfinal.ext.kit.ClassSearcher.extraction(ClassSearcher.java:38)
at com.jfinal.ext.kit.ClassSearcher.search(ClassSearcher.java:178)
at com.jfinal.ext.route.AutoBindRoutes.config(AutoBindRoutes.java:73)
at com.jfinal.config.Routes.add(Routes.java:40)
at com.consame.emoji.common.ConfigInit.configRoute(ConfigInit.java:62)
at com.jfinal.core.Config.configJFinal(Config.java:47)
at com.jfinal.core.JFinal.init(JFinal.java:67)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4603)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1324)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177)
... 31 more
org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests
已经告诉你了缺少jar包哇
这个是缺少jar包,应该不是jfinal的问题java.lang.NoClassDefFoundError:org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests
这个异常说明是缺包
找到原因了,是因为src/test/java/里的测试类也被jFinal扫描加载了,而测试包都不部署到tomcat里的,这是个问题啊版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。