org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor]

Spring JIRA | chaoliu | 4 years ago
  1. 0

    Hi, Our project uses spring 2.5.5 and Tomcat. I have just migrated tomcat from 5.5 to 7. But when starting tomcat, during the context load step, we got the following exception. I think spring scanned all components twice. Has anybody met this exception before? Aug 16, 2012 1:28:35 PM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Aug 16, 2012 1:54:36 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext Aug 16, 2012 1:54:36 PM org.apache.catalina.core.StandardContext listenerStart 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 [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) 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:618) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 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:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:267) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:208) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:85) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 27 more Any hints or pointers would be appreciated. Thank you.

    Spring JIRA | 4 years ago | chaoliu
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor]
  2. 0

    Hi, Our project uses spring 2.5.5 and Tomcat. I have just migrated tomcat from 5.5 to 7. But when starting tomcat, during the context load step, we got the following exception. I think spring scanned all components twice. Has anybody met this exception before? Aug 16, 2012 1:28:35 PM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext Aug 16, 2012 1:54:36 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext Aug 16, 2012 1:54:36 PM org.apache.catalina.core.StandardContext listenerStart 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 [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) 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:618) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 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:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor] at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:267) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:208) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:85) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 27 more Any hints or pointers would be appreciated. Thank you.

    Spring JIRA | 4 years ago | chaoliu
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor]
  3. 0

    Spring: bean conflict with existing non-compatible bean

    Stack Overflow | 4 years ago | user1607834
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring-configuration/application-context.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class[aaa.aaa.ObserverLockMonitor]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring project problem

    eclemma | 8 years ago | olea_s
    java.lang.IllegalStateException: Failed to load ApplicationContext
  6. 0

    Async not working

    Stack Overflow | 1 year ago | OneTwo
    java.lang.IllegalStateException: Annotation-specified bean name 'emailService' for bean class [ie.premiumpower.services.scheduledTaskServices.EmailService] conflicts with existing, non-compatible bean definition of same name and class [ie.premiumpower.services.EmailService]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Annotation-specified bean name 'observerLockMonitor' for bean class [aaa.aaa.ObserverLockMonitor] conflicts with existing, non-compatible bean definition of same name and class [aaa.aaa.ObserverLockMonitor]

      at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate()
    2. Spring Context
      ComponentScanBeanDefinitionParser.parse
      1. org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:267)
      2. org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:208)
      3. org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:85)
      3 frames
    3. Spring Beans
      AbstractBeanDefinitionReader.loadBeanDefinitions
      1. org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
      2. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255)
      3. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245)
      4. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
      5. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
      6. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
      7. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
      8. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
      9. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
      10. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
      11. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
      12. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
      12 frames
    4. Spring
      XmlWebApplicationContext.loadBeanDefinitions
      1. org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
      2. org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
      2 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
      2. org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
      3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
      3 frames
    6. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
      3 frames
    7. Glassfish Core
      HostConfig$DeployWar.run
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      5. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      6. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
      7. org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
      8. org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
      8 frames
    8. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:662)
      6 frames