Tomcat SEVERE: Error listenerStart ... ConflictingBeanDefinitionException

tomcat启动时只报错: Tomcat SEVERE: Error listenerStart。没有详细的报错信息。
查询 logs/localhost.XXXX.log文件找到报错信息如下:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory. BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is org.springframework.context.annotation .ConflictingBeanDefinitionException: Annotation-specified bean name 'alipayAccountDetailDao' for bean class [com.xxx.audit.ca.dao.AccountDetailDao] conflicts with existing, non-compatible bean definition of same name and class [com.xxx.audit.dao.AccountDetailDao]
 
原因:
1. 两个bean的名称相同,引起冲突
2. 包冲突:检查servlet-api.jar包是否冲突。tomcat中自带了,然后工程中是否又加入了这个包,把工程的servlet-api.jar放在jdk中应该能解决
3. target下有缓存,有多个同名的class文件。可通过查找类AccountDetailDao,看一下有几个

你可能感兴趣的:(Tomcat SEVERE: Error listenerStart ... ConflictingBeanDefinitionException)