spring - ClassPathXmlApplicationContext created from several config files overrides beans with the same types and different ids -


I have several spring-config XML files that are being used to create a global context:

   

Let me make references like this:

  private static last string spring CONontext = "global.context"; Private Static Final String BinarF Contact = "Classpath *: Global-Config.exml"; Private configurable applicationsNonnect spring applicationsConsanto; ClassPathXmlServiceLocator () {BeanfishLooccer BeanfertilizerLector = ContextSlatenBinFactorLocator.STASTENS (BinRifConnectx); SpringSpeedSubject = (Configurable App Contexte) BeanFactorLocater. UseBeanFactory (springContext) .getFactory (); }  

The problem is that bean is defined by the same type in each configuration: some.package.BeanType, but when the context is completely instant then that kind of only A bean is available

Classpath XMLApplication Contact is a note in javadoc:

In the case of several config places, the definition of Bean is later overridden with defined in previously loaded files Will go. This can be deliberately leverage to override certain bean definitions through an additional XML file.

But does this mean that beans with different IDs defined in different config files will also be overridden? How can I overcome this issue?

Finally, I found the root cause of the problem. Spring is working correctly all the time. The problem was in the third party category (so called: some. Package.BeanType).


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -