Spring整合Mybatis+C3p0报错

mac2022-06-30  24

报错是这个(粗体的为冲突部分)

org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotationspecified bean name 'c3P0PooledDataSourceMBean' for bean class [com.mchange.v2.c3p0.mbean.C3P0PooledDataSourceMBean] conflicts with existing, noncompatible bean definition of same name and class [com.mchange.v2.c3p0.jboss.C3P0PooledDataSourceMBean]at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:348)

他说名字冲突了,主要是扫描的时候多扫描了一部分

在spring的xml配置文件中,扫描的地方必须只能为持久层的包,不能包含全部的包。如果扫描全部的包就会报错。

 

 

最新回复(0)