|
#1
|
|||
|
|||
|
Hi All,
i'm new to Spring and have a question about the xml-bean definitions. I'm working on a project where spring is (supposed to be) used for configuring/running JUnit tests. The xml-definitions have been split in to (lots multiple files . But now when i run a unit test and Spring is loading the xml files i get the statement Overiding bean definition for bean ........ For small bean configurations this is not a problem, but for the larger files it is pretty annoying (as it takes time). Obviously the best thing to do is refactor the configuration files, but still the question remains: Is there someway to tell spring not to overide a bean definition if it already exists? Or even better tell spring not to import a configuration file if it already has been imported? |
|
#2
|
|||
|
|||
|
I had the same problem and I came up with an application context class which detects duplicate imports.
It is a hack, but it is good enough until Interface21 guys decide to add this feature to Spring. Here is the solution: http://piotrga.wordpress.com/2007/03...ore-than-once/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|