title: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'documentumServiceForIDP' is defined
body: <p>I have a scenario where we deployed two EAR's on JBoss4.2.3. Each Ear has its own applicationContext defined. But I realized while debugging, one application bean definitions overriding the other. </p>
  
  <p>Here is the server log:</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <pre><code>09:23:23,962 INFO 
  &gt; [XmlWebApplicationContext] Refreshing
  &gt; org.springframework.web.context.support.XmlWebApplicationContext@1b4aee4:
  &gt; display name [Root
  &gt; WebApplicationContext]; startup date
  &gt; [Thu Jul 08 09:23:23 MDT 2010]; root
  &gt; of context hierarchy 09:23:24,103 INFO
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from ServletContext
  &gt; resource
  &gt; [/WEB-INF/applicationContext-idp.xml]
  &gt; 09:23:24,166 INFO 
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp608645178333044413IDP.ear-contents/IDPEJB.jar!/META-INF/applicationContext.xml]
  &gt; 09:23:24,181 INFO 
  &gt; [XmlWebApplicationContext] Bean
  &gt; factory for application context
  &gt; [org.springframework.web.context.support.XmlWebApplicationContext@1b4aee4]:
  &gt; org.springframework.beans.factory.support.DefaultListableBeanFactory@8478d0
  &gt; 09:23:24,384 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Pre-instantiating singletons in
  &gt; org.springframework.beans.factory.support.DefaultListableBeanFactory@8478d0:
  &gt; defining beans
  &gt; [**powersuiteServiceFactory,url,qname,powersuiteService,IDPDocumentumServiceFactory,documentumServiceForIDP,applicationUserName,IDPApplicationContextProvider,idpdctmfactory,externalService,brokerIp,jmsConnectionFactory,redeliveryPolicy,jmsDestination,IDPjmsTemplate,jmsProducer,jmsListener,transactionManager,IDPJmsContainer**];
  &gt; root of factory hierarchy
  &gt; 
  &gt; [[/SecureClaim]] Initializing Spring
  &gt; root WebApplicationContext
  &gt; 09:23:45,260 INFO  [ContextLoader]
  &gt; Root WebApplicationContext:
  &gt; initialization started 09:23:45,275
  &gt; INFO  [XmlWebApplicationContext]
  &gt; Refreshing
  &gt; org.springframework.web.context.support.XmlWebApplicationContext@1fbf66c:
  &gt; display name [Root
  &gt; WebApplicationContext]; startup date
  &gt; [Thu Jul 08 09:23:45 MDT 2010]; root
  &gt; of context hierarchy 09:23:45,275 INFO
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from ServletContext
  &gt; resource
  &gt; [/WEB-INF/applicationContext.xml]
  &gt; 09:23:45,291 INFO 
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp608645178333044413IDP.ear-contents/IDPEJB.jar!/META-INF/applicationContext.xml]
  &gt; 09:23:45,306 INFO 
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsFacelet.jar!/META-INF/applicationContext.xml]
  &gt; 09:23:45,322 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Overriding bean definition for bean
  &gt; 'applicationContextProvider':
  &gt; replacing [Generic bean: class
  &gt; [org.idahosif.sips.common.spring.ApplicationContextProvider];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in
  &gt; ServletContext resource
  &gt; [/WEB-INF/applicationContext.xml]]
  &gt; with [Generic bean: class
  &gt; [org.idahosif.sips.common.spring.ApplicationContextProvider];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsFacelet.jar!/META-INF/applicationContext.xml]]
  &gt; 09:23:45,322 INFO 
  &gt; [XmlBeanDefinitionReader] Loading XML
  &gt; bean definitions from URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsMessaging.jar!/META-INF/applicationContext.xml]
  &gt; 09:23:45,322 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Overriding bean definition for bean
  &gt; 'brokerIp': replacing [Generic bean:
  &gt; class
  &gt; [org.apache.activemq.ActiveMQConnectionFactory];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp608645178333044413IDP.ear-contents/IDPEJB.jar!/META-INF/applicationContext.xml]]
  &gt; with [Generic bean: class
  &gt; [org.apache.activemq.ActiveMQConnectionFactory];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsMessaging.jar!/META-INF/applicationContext.xml]]
  &gt; 09:23:45,322 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Overriding bean definition for bean
  &gt; 'redeliveryPolicy': replacing [Generic
  &gt; bean: class
  &gt; [org.apache.activemq.RedeliveryPolicy];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp608645178333044413IDP.ear-contents/IDPEJB.jar!/META-INF/applicationContext.xml]]
  &gt; with [Generic bean: class
  &gt; [org.apache.activemq.RedeliveryPolicy];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsMessaging.jar!/META-INF/applicationContext.xml]]
  &gt; 09:23:45,338 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Overriding bean definition for bean
  &gt; 'transactionManager': replacing
  &gt; [Generic bean: class
  &gt; [org.springframework.transaction.jta.JtaTransactionManager];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp608645178333044413IDP.ear-contents/IDPEJB.jar!/META-INF/applicationContext.xml]]
  &gt; with [Generic bean: class
  &gt; [org.springframework.transaction.jta.JtaTransactionManager];
  &gt; scope=singleton; abstract=false;
  &gt; lazyInit=false; autowireMode=0;
  &gt; dependencyCheck=0;
  &gt; autowireCandidate=true; primary=false;
  &gt; factoryBeanName=null;
  &gt; factoryMethodName=null;
  &gt; initMethodName=null;
  &gt; destroyMethodName=null; defined in URL
  &gt; [jar:file:/C:/jboss-4.2.3.GA/server/default/tmp/deploy/tmp7456914759893588436SecureClaim.ear-contents/SipsMessaging.jar!/META-INF/applicationContext.xml]]
  &gt; 09:23:45,338 INFO 
  &gt; [XmlWebApplicationContext] Bean
  &gt; factory for application context
  &gt; [org.springframework.web.context.support.XmlWebApplicationContext@1fbf66c]:
  &gt; org.springframework.beans.factory.support.DefaultListableBeanFactory@1632823
  &gt; 09:23:45,494 INFO 
  &gt; [DefaultListableBeanFactory]
  &gt; Pre-instantiating singletons in
  &gt; org.springframework.beans.factory.support.DefaultListableBeanFactory@1632823:
  &gt; defining beans
  &gt; [**powersuiteServiceFactory,url,qname,powersuiteService,documentumServiceFactory,documentumRepository,applicationContextProvider,brokerIp,jmsConnectionFactory,redeliveryPolicy,jmsDestination,IDPjmsTemplate,jmsProducer,jmsListener,transactionManager,IDPJmsContainer,externalServiceFactory,configProperties,externalServiceForIndex,appExternalVarForCAP,processVariables,connectionFactory,destination,jmsTemplate,jmsSender,messageListener,jmsContainer**];
  &gt; root of factory hierarchy**
  </code></pre>
  
  <p>I struggling on this for couple of days but I haven't find solution. Please help me if anyone gone through this issue before.</p>