在IDEA中使用druid连接池找不到dataSource的问题
druid
阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
项目地址:https://gitcode.com/gh_mirrors/druid/druid

·
使用maven管理依赖,也添加了druid的依赖,但就是报错
Cannot find class [com.alibaba.druid.pool.DruidDataSource] for bean with name ‘dataSource’ defined in class path resource [config/spring.xml]; nested exception is java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSource
tomcat 启动后报的错误提示如下:
解决方案:
IDEA中,File > Project Structure > Artifacts > Avaliable Elements
双击依赖druid即可添加到输出路径中的lib包下。这样就不会报错了
正常情况下,这里是会自动把依赖的jar添加至这里,但上面的是特殊情况,需要
自己操作实现。




阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
最近提交(Master分支:1 个月前 )
a71fa6ad - 18 天前
0b375e47 - 25 天前
更多推荐
所有评论(0)