项目编译时不报错,启动时报DruidPlugin的错,不知道什么原因,求大神帮忙

项目编译时不报错,启动时报DruidPlugin的错,不知道什么原因,

代码如下

DruidPlugin druidPlugin = DruidPlugin(PropKit.().trim()PropKit.().trim()PropKit.().trim())druidPlugin.setInitialSize()druidPlugin.setMinIdle()druidPlugin.setMaxActive()druidPlugin.setRemoveAbandoned()druidPlugin.setRemoveAbandonedTimeoutMillis(*)druidPlugin.setTestWhileIdle()druidPlugin.setTestOnBorrow()druidPlugin.setTestOnReturn()druidPlugin.setTimeBetweenEvictionRunsMillis()druidPlugin.setMinEvictableIdleTimeMillis()druidPlugin.setValidationQuery()druidPlugin.setTimeBetweenEvictionRunsMillis()

运行报错如下:

java.lang.NoSuchMethodError: com.jfinal.plugin.druid.DruidPlugin.setRemoveAbandoned(Z)Lcom/jfinal/plugin/druid/DruidPlugin;

求大神帮忙

评论区

JFinal

2017-05-05 21:00

升级一下 druid 试试

wangqian0628

2017-05-08 15:31

严重: Exception starting filter JFinalFilter
java.lang.NoSuchMethodError: com.jfinal.plugin.druid.DruidPlugin.setTimeBetweenConnectErrorMillis(J)Lcom/jfinal/plugin/druid/DruidPlugin;
at com.weishop.cfg.JFWebConfig.configPlugin(JFWebConfig.java:168)
at com.jfinal.core.Config.configJFinal(Config.java:53)
at com.jfinal.core.JFinal.init(JFinal.java:63)
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.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
这个错误怎么解决?

JFinal

2017-05-09 11:09

@wangqian0628 昨天已经在 qq 里告诉你如何解决了,通常版本问题,如果版本问题被排除那么是有多个 jar 包对不同版本的 druid 有依赖,某个版本的 druid 被 ClassLoader 加载以后,造成另外一个对 druid 有依赖的版本不对

wangqian0628

2017-05-09 16:33

@JFinal 好的,谢谢

热门反馈

扫码入社