tomcat下使用druid连接池报错--illegal maxPoolSize

反转世界 发布于 2016/08/29 17:11
阅读 1K+
收藏 0

收藏!数据建模最全知识体系解读!>>>

使用 jfinal的框架 , 在jetty下 完全没问题,正常发布使用,

但是在 tomcat下部署项目,启动时 会 报错

log4j:WARN No appenders could be found for logger (com.jfinal.core.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
八月 29, 2016 5:00:55 下午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter jfinal
java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 
java.lang.IllegalArgumentException: illegal maxPoolSize
at com.jfinal.core.Config.startPlugins(Config.java:97)
at com.jfinal.core.Config.configJFinal(Config.java:49)
at com.jfinal.core.JFinal.init(JFinal.java:62)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5546)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1258)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1918)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.jfinal.plugin.activerecord.ActiveRecordException: java.lang.IllegalArgumentException: illegal maxPoolSize
at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:54)
at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:225)
at com.jfinal.core.Config.startPlugins(Config.java:88)
... 20 more
Caused by: java.lang.IllegalArgumentException: illegal maxPoolSize
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:252)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:379)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:375)
at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:42)
... 22 more

是我配置错了什么东西,还是我少配置了什么?

好像是我tomcat的问题?

configPlugin的配置,这里是不是需要做其他的配置?

loadPropertyFile("config.property");
DruidPlugin dp = new DruidPlugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password"));
dp.addFilter(new StatFilter());
WallFilter wall = new WallFilter();
wall.setDbType("mysql");
dp.addFilter(wall);
arg0.add(dp);getProperty("password"));
ActiveRecordPlugin arp0 = new ActiveRecordPlugin(dp);
arg0.add(arp0);
_MappingKit.mapping(arp0);

加载中
返回顶部
顶部