addSqlTemplate 提示找不到sql

configPlugin(Plugins me)中

ActiveRecordPlugin activeRecordPlugin = new ActiveRecordPlugin(new SpringDataSourcePlugin());
            activeRecordPlugin.setShowSql(true);
            activeRecordPlugin.setDevMode(true);
            activeRecordPlugin.setContainerFactory(new CaseInsensitiveContainerFactory(true));
//            activeRecordPlugin.setBaseSqlTemplatePath(PathKit.getRootClassPath());
//            activeRecordPlugin.setBaseSqlTemplatePath(null);
//            activeRecordPlugin.getEngine().setSourceFactory(new ClassPathSourceFactory());
            activeRecordPlugin.addSqlTemplate("/conf/sql/init.sql");
            _MappingKit.mapping(activeRecordPlugin);
            me.add(activeRecordPlugin);

目录结构

image.png

提示

org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [conf/sql/init.sql]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.

java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [conf/sql/init.sql]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.

at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1384)

at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1034)

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

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.sql.SqlKit.parseSqlTemplate(SqlKit.java:93)

at com.ofsoft.cms.core.config.AutoReloadSqlConfig.run(AutoReloadSqlConfig.java:43)


评论区

think-takn

2019-08-08 15:24

不用了 问题找到了 不是jfinal的原因 好像没有删除帖子功能啊

热门反馈

扫码入社