2018-08-27 17:58:11
[ERROR]-[Thread: main]-[com.jfinal.core.Config.startPlugins()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin.
File not found : E:\workspaces\waiter\file:\E:\workspaces\waiter\src\main\webapp\WEB-INF\lib\alipay-sdk-java20180309170622.jar!/_user.sql
java.lang.RuntimeException: File not found : E:\workspaces\waiter\file:\E:\workspaces\waiter\src\main\webapp\WEB-INF\lib\alipay-sdk-java20180309170622.jar!/_user.sql
at com.jfinal.template.source.FileSource.getContent(FileSource.java:70)
at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:153)
at com.jfinal.template.Engine.getTemplate(Engine.java:138)
at com.jfinal.plugin.activerecord.sql.SqlKit.parseSqlTemplate(SqlKit.java:92)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:224)
at com.jfinal.core.Config.startPlugins(Config.java:107)
at com.jfinal.core.Config.configJFinal(Config.java:51)
at com.jfinal.core.JFinal.init(JFinal.java:63)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServerForIDEA.doStart(JettyServerForIDEA.java:133)
at com.jfinal.server.JettyServerForIDEA.start(JettyServerForIDEA.java:72)
at com.jfinal.core.JFinal.start(JFinal.java:174)
at com.dlhz.common.Start.main(Start.java:14)
2018-08-27 17:58:11
[ERROR]-[Thread: main]-[com.jfinal.kit.LogKit.error()]: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin.
File not found : E:\workspaces\waiter\file:\E:\workspaces\waiter\src\main\webapp\WEB-INF\lib\alipay-sdk-java20180309170622.jar!/_user.sql
java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin.
File not found : E:\workspaces\waiter\file:\E:\workspaces\waiter\src\main\webapp\WEB-INF\lib\alipay-sdk-java20180309170622.jar!/_user.sql
at com.jfinal.core.Config.startPlugins(Config.java:116)
at com.jfinal.core.Config.configJFinal(Config.java:51)
at com.jfinal.core.JFinal.init(JFinal.java:63)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:277)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at com.jfinal.server.JettyServerForIDEA.doStart(JettyServerForIDEA.java:133)
at com.jfinal.server.JettyServerForIDEA.start(JettyServerForIDEA.java:72)
at com.jfinal.core.JFinal.start(JFinal.java:174)
at com.dlhz.common.Start.main(Start.java:14)
Caused by: java.lang.RuntimeException: File not found : E:\workspaces\waiter\file:\E:\workspaces\waiter\src\main\webapp\WEB-INF\lib\alipay-sdk-java20180309170622.jar!/_user.sql
at com.jfinal.template.source.FileSource.getContent(FileSource.java:70)
at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:153)
at com.jfinal.template.Engine.getTemplate(Engine.java:138)
at com.jfinal.plugin.activerecord.sql.SqlKit.parseSqlTemplate(SqlKit.java:92)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:224)
at com.jfinal.core.Config.startPlugins(Config.java:107)
... 18 more
下面是我的配置信息
注释掉下main红色部分项目就能启动,去掉注释就启动报上面的错
public class ProjectConfig extends JFinalConfig {
/**
* 配置常量
*/
@Override
public void configConstant(Constants me) {
PropKit.use("projectConfig.properties");
me.setDevMode(PropKit.getBoolean("devMode", true));// 是否启用开发模式
me.setJsonFactory(MixedJsonFactory.me());// 由于jfinal自身对json转换的不足,使用fastjson对json转对象做补充
me.setError404View("/error/404.html");
me.setErrorView(405, "/error/405.html");
}
@Override
public void configEngine(Engine me) {
// TODO Auto-generated method stub
}
@Override
public void configHandler(Handlers me) {
me.add(new HtmlFakeStaticHandler(".do"));
}
@Override
public void configInterceptor(Interceptors me) {
me.add(new SessionInViewInterceptor());// jfinal template
// engine,设计为可以在任何 java
// 环境中运行,所以默认不会知道,session
// 的存在,需要添加session拦截器
me.add(new AllowCrossDomainInterceptor());
}
@Override
public void configPlugin(Plugins me) {
/**
* 配置数据源 开始
*/
DruidPlugin druidPlugin = createDruidPlugin();
me.add(druidPlugin);
ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
arp.setTransactionLevel(Connection.TRANSACTION_READ_COMMITTED);
_MappingSqlKit.mapping(arp);
_MappingKit.mapping(arp);
PropKit.use("projectConfig.properties");
if (PropKit.getBoolean("devMode", false)) {
arp.setShowSql(true);
}
me.add(arp);
/**
* 配置redis
*/
RedisPlugin rp = null;
if (StrKit.notBlank(PropKit.use("redis.properties").get("password"))) {
rp = new RedisPlugin(PropKit.use("redis.properties").get("topic"),
PropKit.use("redis.properties").get("host"), PropKit.use("redis.properties").getInt("port"),
PropKit.use("redis.properties").get("password"));
} else {
rp = new RedisPlugin(PropKit.use("redis.properties").get("topic"),
PropKit.use("redis.properties").get("host"), PropKit.use("redis.properties").getInt("port"));
}
me.add(rp);
/**
* 配置定时任务
*/
QuartzPlugin quartzPlugin = new QuartzPlugin();
quartzPlugin.setJobs("jobs.properties");
me.add(quartzPlugin);
}
@Override
public void configRoute(Routes me) {
me.add(new ManagerLoginRoute());
me.add(new ManagerRoute());
me.add(new MerchantLoginRoute());
me.add(new MerchantRoute());
me.add(new MerchantAppLoginRoute());
me.add(new MerchantAppRoute());
me.add(new AgentAppLoginRoute());
me.add(new AgentAppRoute());
me.add(new DataScreenRoote());
me.add(new WeiXinQrRoute());
me.add(new WeiXinQrLoginRoute());
me.add(new QrAfterMealLoginRoute());
me.add(new QrAfterMealRoute());
me.add("/commmon/upload", UploadController.class);
me.add("/common/address",AddressController.class);
me.add("/common/merchantSuperJurisdiction",MerchantSuperJurisdictionController.class);
me.add("/test",TestController.class);
me.add("/pay/zfb",ZfxController.class);
me.add("/xingye/pay/staticCode",XingYeJIntaiController.class);
me.add("/merchant/weixin/weixin",WeixinController.class); // 微信回调
me.add("/merchant/getpassword", GetPasswordOfBackWindow.class);
//me.add("/merchant/qr/weixin",WeiXinController.class); // 微信登录路由
}
/*
* 数据库连接池配置
*/
public static DruidPlugin createDruidPlugin() {
Prop p = PropKit.use("mysqlConfig.properties");
return new DruidPlugin(p.get("jdbcUrl"), p.get("user"), p.get("password"));
}
@Override
public void afterJFinalStart() {
try {
MsgType.wsstart = new MyWsStart(12316, new MyMsgHandler());
MsgType.wsstart.start();
} catch (IOException e) {
System.out.println("websocket已启动了");
}
}
@Override
public void beforeJFinalStop() {
MsgType.wsstart.stop();
}
}
_MappingSqlKit.mapping(arp)文件内容:
public static void mapping(ActiveRecordPlugin arp) {
arp.setBaseSqlTemplatePath(PathKit.getRootClassPath());
arp.addSqlTemplate("_user.sql");
arp.addSqlTemplate("_managerLog.sql");
arp.addSqlTemplate("_userManager.sql");
arp.addSqlTemplate("_managerMenu.sql");
arp.addSqlTemplate("_managerRole.sql");
arp.addSqlTemplate("_managerMenuRole.sql");
arp.addSqlTemplate("_agent.sql");
arp.addSqlTemplate("_provinces.sql");
arp.addSqlTemplate("_citis.sql");
arp.addSqlTemplate("_areas.sql");
arp.addSqlTemplate("_merchant.sql");
arp.addSqlTemplate("_merchantAdmin.sql");
arp.addSqlTemplate("_merchantRoleMenu.sql");
arp.addSqlTemplate("_merchantMenu.sql");
arp.addSqlTemplate("_merchantRole.sql");
arp.addSqlTemplate("_kitchenPrinter.sql");
arp.addSqlTemplate("_merchantLog.sql");
arp.addSqlTemplate("_dishes.sql");
arp.addSqlTemplate("_tableClassification.sql");
arp.addSqlTemplate("_table.sql");
arp.addSqlTemplate("_commodityGallery.sql");
arp.addSqlTemplate("_food.sql");
arp.addSqlTemplate("_orderForm.sql");
arp.addSqlTemplate("_orderDetail.sql");
arp.addSqlTemplate("_orderLog.sql");
arp.addSqlTemplate("_book.sql");
arp.addSqlTemplate("_payment.sql");
arp.addSqlTemplate("_orderPaytype.sql");
arp.addSqlTemplate("_userCard.sql");
arp.addSqlTemplate("_cardBalanceRecord.sql");
arp.addSqlTemplate("_cardIntegralRecord.sql");
arp.addSqlTemplate("_print_template.sql");
arp.addSqlTemplate("_turnoverRecord.sql");
arp.addSqlTemplate("_agentLog.sql");
arp.addSqlTemplate("_agentProfitRecord.sql");
arp.addSqlTemplate("_systemBasic.sql");
arp.addSqlTemplate("_agentPresentRecord.sql");
arp.addSqlTemplate("_notice.sql");
arp.addSqlTemplate("_callRecord.sql");
arp.addSqlTemplate("_callClassification.sql");
arp.addSqlTemplate("_merchantNotice.sql");
arp.addSqlTemplate("_merchantUpdate.sql");
arp.addSqlTemplate("_turnoverRechargeMethod.sql");
arp.addSqlTemplate("_turnoverRechargeRecord.sql");
arp.addSqlTemplate("_msgrecord.sql");
arp.addSqlTemplate("_usercardclassification.sql");
arp.addSqlTemplate("_usercardAccounting.sql");
arp.addSqlTemplate("_merchantappMenu.sql");
arp.addSqlTemplate("_merchantappRoleMenu.sql");
arp.addSqlTemplate("_materielStock.sql");
arp.addSqlTemplate("_materiel.sql");
arp.addSqlTemplate("_materielInstockl.sql");
arp.addSqlTemplate("_materielOutstock.sql");
arp.addSqlTemplate("_merchantClassify.sql");
arp.addSqlTemplate("_orderDiscount.sql");
arp.addSqlTemplate("_orderRefund.sql");
arp.addSqlTemplate("_merchantUserNo.sql");
arp.addSqlTemplate("_kitchenPrinterClass.sql");
arp.addSqlTemplate("_merchantBackMerchant.sql");
}