1.错误类型
Druid初始化失败,控制台具体信息:
com.alibaba.druid.pool.DruidDataSource error
严重: {dataSource-1} init error
java.lang.IncompatibleClassChangeError: Implementing class
单元测试错误信息:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'druid' defined in class path resource [spring-datasource.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError
2.已确定代码和数据库连接没问题,将别人成功运行的项目以及本地依赖库导进来,出现同样的错误。
3.一种尝试的解决方案是:将druid的依赖版本降到1.0.15以下(项目中为1.1.10),可以避免错误。原来考虑包冲突,但是别人能正常使用以下依赖的组合。所以