启动项目时报错

在测试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);

不知道怎么弄了,启动不了

评论区

JFinal

2018-05-23 16:20

应该是你的项目中有多个 jfinal 版本,删掉其它,只留 jfinal 3.4 即可

ywen_chan

2018-05-23 17:10

@JFinal 找到问题了,确实是版本重复的问题,应用了一个三方的jar,里面用了jfianl的源码,导致我接入jfinal之后,运行就报错,谢谢波总

热门反馈

扫码入社