在测试jfinal-demo时,改成tomcat启动。启动正常,只是有些资源404,改了路径就好了,但是在自己项目中,改用tomcat部署时就报错了,第一次用jfinal,求各位解答,具体报错如下:
五月 23, 2018 3:12:42 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter [jfinal]
java.lang.NoSuchFieldError: me
at com.jfinal.plugin.activerecord.dialect.Dialect.<init>(Dialect.java:45)
at com.jfinal.plugin.activerecord.dialect.MysqlDialect.<init>(MysqlDialect.java:29)
at com.jfinal.plugin.activerecord.Config.<init>(Config.java:50)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.<init>(ActiveRecordPlugin.java:75)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.<init>(ActiveRecordPlugin.java:83)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.<init>(ActiveRecordPlugin.java:79)
at com.jiasheng.common.MyConfig.configPlugin(MyConfig.java:125)
at com.jfinal.core.Config.configPluginWithOrder(Config.java:70)
at com.jfinal.core.Config.configJFinal(Config.java:56)
at com.jfinal.core.JFinal.init(JFinal.java:63)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
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)
五月 23, 2018 3:12:42 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
五月 23, 2018 3:12:42 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/jfinal_demo] startup failed due to previous errors
五月 23, 2018 3:12:42 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
五月 23, 2018 3:12:42 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
五月 23, 2018 3:12:42 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 6680 ms
其中报错的125行代码如下:
// 配置ActiveRecord插件
ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
arp.setShowSql(true);
// 统一全部默认小写,数据库字段不区分大小写
arp.setContainerFactory(new CaseInsensitiveContainerFactory(true));
// 所有映射在 MappingKit 中自动化搞定
_MappingKit.mapping(arp);
me.add(arp);
不知道怎么弄了,启动不了