无法转换为java.lang.Class

QQ截图20190327185028.png

评论区

xiezhineng

2019-03-27 18:52

@JFinal 这个怎么破 IDEA没用报错

杜福忠

2019-03-27 21:09

clazz 是什么梗?
感觉你不是这样用的啊? https://www.jfinal.com/doc/5-2

xiezhineng

2019-03-28 09:17

老板自己写的,放在eclipse跑完全没用问题,在IDEA跑就出错了@JFinal

xiezhineng

2019-03-28 09:39

这是代码
List> modelClassList = ClassScanner.scanSubClass(Model.class);
if (modelClassList !=null && modelClassList.size()>0) {
for (Class clazz : modelClassList) {
Table mapping = clazz.getAnnotation(Table.class);
if (mapping == null) continue;

String tableName = mapping.tableName();
if (tableName == null) continue;

activeRecordPlugin.addMapping(tableName, (Class>) clazz);
}
}

JFinal

2019-03-28 10:33

@xiezhineng jfinal 生成器已经将 addMapping 自动化了,无需写这些代码

xiezhineng

2019-03-28 10:40

@JFinal java.io.FileNotFoundException: Template "/login.html" not found. The quoted name was interpreted by this template loader: WebappTemplateLoader(servletContext.name=null, subdirPath="/WEB-INF/template/").。后台显示路由信息了,出现java.io.FileNotFoundException,文件是存在的,路径估计也没问题,

PeterYan

2020-10-05 15:55

同样的问题,应该怎么解决
java: incompatible types: java.lang.Class cannot be converted to java.lang.Class>

PeterYan

2020-10-05 15:57

也是在idea中出现这样的错误

热门反馈

扫码入社