bossArp.start();报错误

DruidPlugin dp = new DruidPlugin(json.getString("url"), json.getString("user"), json.getString("pwd"));

         dp.setInitialSize(20);

        dp.setMaxActive(30);

        dp.setMinIdle(10);

            ActiveRecordPlugin bossArp = new ActiveRecordPlugin(systemCode, dp);

            bossArp.setDialect(new SqlServerDialect());

            bossArp.setContainerFactory(new CaseInsensitiveContainerFactory());//忽略大小写

            bossArp.start();

异常如下

java.lang.RuntimeException: ActiveRecord start error: ActiveRecordPlugin need DataSource or DataSourceProvider

at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:221) ~[jfinal-3.7.jar:na]

at com.exchange.server.config.DbSource.init(DbSource.java:37) ~[classes/:na]

at com.exchange.server.IndexController.initApiConfig(IndexController.java:45) ~[classes/:na]

at com.gitee.easyopen.support.ApiController.onStartup(ApiController.java:136) ~[easyopen-1.16.0.jar:na]

at com.gitee.easyopen.support.ApiController.onApplicationEvent(ApiController.java:115) ~[easyopen-1.16.0.jar:na]

at com.gitee.easyopen.support.ApiController.onApplicationEvent(ApiController.java:75) ~[easyopen-1.16.0.jar:na]

at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]

at com.exchange.server.ExchangeSpringbootApplication.main(ExchangeSpringbootApplication.java:11) [classes/:na]


评论区

要输就输给追求

2019-05-15 18:20

异常已经说得很清楚了 没有DataSource。要先dp.start();然后再bossArp.start();