java.lang.NoClassDefFoundError: com/alibaba/druid/pool/DruidDataSource

@Override

public void configPlugin(Plugins me) {

DruidPlugin dp =  new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"),PropKit.get("password"));

        me.add(dp);

        

        ActiveRecordPlugin arp = new ActiveRecordPlugin(dp);

        me.add(arp);

}


java.lang.NoClassDefFoundError: com/alibaba/druid/pool/DruidDataSource

at com.jfinal.plugin.druid.DruidPlugin.start(DruidPlugin.java:180)

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.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)

at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)

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:633)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1120)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1678)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSource

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)

... 22 more


评论区

JFinal

2018-05-05 10:36

maven 下载 druid 的 jar 包失败,删除一下本地 maven 库中的 druid 目录,让 ecilpse 重新下载一次即可

逻辑是很牛的

2018-05-05 11:13

@JFinal 我用的是web project项目,删了jar包在下试过了,还是不行

友花

2018-11-14 20:48

@JFinal 我用的也是web project项目,不是maven的,也是这个错误,不知道错误在哪?

李桔梗

2019-01-14 10:33

@友花 druid 的jar包没添加进去吧

MarlonBrando

2019-08-28 18:51

@JFinal 删除下载也不行,更换版本也不行

热门反馈

扫码入社