连接数据库,查询不出东西一直报错

异常如下

[ERROR]-[Thread: http-apr-8090-exec-8]-[com.jfinal.core.ActionHandler.handle()]: /cpys/show

com.jfinal.plugin.activerecord.ActiveRecordException: java.lang.IllegalAccessException: Class com.jfinal.plugin.activerecord.ModelBuilder can not access a member of class com.netinnet.manualresource.model.Product with modifiers ""

configPlugin方法如下:

@Override

public void configPlugin(Plugins me) {

String jdbcUrl = JdbcConfigBean.JDBC_URL;

String user = JdbcConfigBean.JDBC_USER;

String password = JdbcConfigBean.JDBC_PASSWORD;

C3p0Plugin c3p0Plugin = new C3p0Plugin(jdbcUrl, user, password);

me.add(c3p0Plugin);

ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);

me.add(arp);

arp.addMapping(Visitor.TABLE_NAME, Visitor.PRIMARY_KEY, Visitor.class);

arp.addMapping(Product.TABLE_NAME, Product.PRIMARY_KEY, Product.class);

EhCachePlugin ecp = new EhCachePlugin();

me.add(ecp);

}



评论区

JFinal

2018-04-17 14:58

看看是不是这个问题:
http://www.jfinal.com/feedback/2429

caicm

2018-04-17 15:08

不是,我用的是Myeclipse开发

caicm

2018-04-17 15:09

@JFinal 配置都与官方文档上一致,但却一直报错

JFinal

2018-04-17 15:27

异常的 cause 部分呢? 这个异常奇怪,从来没有碰到过

caicm

2018-04-17 15:30

@JFinal
Caused by: java.lang.IllegalAccessException: Class com.jfinal.plugin.activerecord.ModelBuilder can not access a member of class com.netinnet.manualresource.model.Product with modifiers ""

JFinal

2018-04-17 15:39

@caicm 如果是 maven 项目,则删掉所有文件,只保留 pom.xml 与 src 目录,然后当成 maven 项目重新 import 到 eclipse 中去

我怀疑是你的项目配置有问题

caicm

2018-04-17 16:21

@JFinal 行了,谢谢啦

热门分享

扫码入社