Community   SpringSource   Projects    Downloads    Documentation    Forums    Training   Exchange   Blogs

Go Back   Spring Community Forums > Core Spring Projects > Core Container

Reply
 
Thread Tools Display Modes
  #1  
Old Jul 12th, 2006, 02:35 AM
mienamang mienamang is offline
Junior Member
 
Join Date: Jul 2006
Posts: 1
Default Prevent Overriding bean definition

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?
Reply With Quote
  #2  
Old Mar 21st, 2007, 02:17 PM
piotrga piotrga is offline
Junior Member
 
Join Date: Mar 2007
Posts: 5
Default

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/
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:55 AM.


Contegix provides first-class managed hosting and partial sponsorship of these forums.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.