求前辈帮帮忙

java.lang.Error: 无法解析的编译问题:

类型 ActiveRecordPlugin 中的方法 addMapping(String, Class<? extends Model<?>>)对于参数(String, Class<User>)不适用


at com.common.MainConfig.configPlugin(MainConfig.java:43)

at com.jfinal.core.Config.configJFinal(Config.java:53)

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: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:4700)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:748)

controller.pngMainConfig1.png

评论区

JFinal

2017-05-10 09:37

find 的参数传得不对而已,这个问题很基本,建议去首页下载 jfinal demo,里面有实际的例子可参考

User 中不建议创建 dao 对象,创建业务层,将 dao 放业务层,所有业务逻辑与 sql 全放业务层,昨天晚上 jfinal demo 已经更新过,下载参考一下

LiJunv5

2017-05-10 11:34

User user =user.dao.findFirst(sql语句);

热门反馈

扫码入社