独立 activerecord找不到 "com/jfinal/plugin/activerecord/generator/base_model_template.jf"

333.jpg

Base Model Output Dir: D:\IDEA2018_3_2_work\work\du-config-tools/../src/model/base

Exception in thread "main" java.lang.IllegalArgumentException: File not found in CLASSPATH or JAR : "com/jfinal/plugin/activerecord/generator/base_model_template.jf"

at com.jfinal.template.source.ClassPathSource.<init>(ClassPathSource.java:67)

at com.jfinal.template.source.ClassPathSourceFactory.getSource(ClassPathSourceFactory.java:29)

at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:158)

at com.jfinal.template.Engine.getTemplate(Engine.java:145)

at com.jfinal.plugin.activerecord.generator.BaseModelGenerator.genBaseModelContent(BaseModelGenerator.java:113)

at com.jfinal.plugin.activerecord.generator.BaseModelGenerator.generate(BaseModelGenerator.java:103)

at com.jfinal.plugin.activerecord.generator.Generator.generate(Generator.java:278)

at com.config.tools.common.config.ActiveRecordPluginConfig.main(ActiveRecordPluginConfig.java:102)

Disconnected from the target VM, address: '127.0.0.1:56648', transport: 'socket'


评论区

JFinal

2019-03-31 17:54

刚看了一下,打包忘了一个配置,模板文件没有打进去,在这里下载模板文件:
https://gitee.com/jfinal/activerecord/tree/master/src/main/java/com/jfinal/plugin/activerecord/generator

然后将模板文件放入 src/main/resources 下面,最后配置一下:
generator.setBaseModelTemplate("base_model_template.jf");

其它几个也这样来操作

JFinal

2019-03-31 17:57

刚刚已经添加了配置,感谢反馈:
https://gitee.com/jfinal/activerecord/commit/87e94cf901689c559dfdf6cd3a0177e221a65544

JFinal

2019-04-06 23:10

jfinal 的 activerecord 3.8 已经发布,模板文件已经打包到了 jar 包之中,可以直接升级

hello-jfinal

2019-12-06 10:56

@JFinal 你好,我这边把base_model_template.jf文件拷贝到resource路径下,并且修改了对应的generator中的配置信息protected String template = "/base_model_template.jf";还是报异常Exception in thread "main" java.lang.IllegalArgumentException: File not found in CLASSPATH or JAR : "base_model_template.jf",请问这个要怎么解决?

JFinal

2019-12-07 00:17

@hello-jfinal 在 target/classes 下面去看一下,到底这个 base_model_template.jf 是不是存在,要看现场

hello-jfinal

2019-12-09 09:30

@JFinal 在target/classes下 base_model_template.jf 文件是存在了的

热门反馈

扫码入社