Skip to content

Make it easier to disallow bean definition overriding [SPR-3734] #8415

@spring-projects-issues

Description

@spring-projects-issues

Trent Andrews opened SPR-3734 and commented

If you have two beans in the same xml(Example 1) file spring will detect that you have two beans with the same name and throw XmlBeanDefinitionStoreException

===== Example 1 =====
<bean id="foo1" class="foo.Foo"><property name="echo" value="1"/></bean>
<bean id="foo1" class="foo.Foo"><property name="echo" value="2"/></bean>


But if you import one xml file into another it does not see the problem and I believe that it should.

==== Example 2 ====


File 1


<import resource="file2.xml"/>
<bean id="foo1" name="foo1" class="foo.Foo"><property name="echo" value="1"/></bean>

File 2(file2.xml)


<bean id="foo1" name="foo1" class="foo.Foo"><property name="echo" value="1"/></bean>


Affects: 2.0.6

Attachments:

Issue Links:

2 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions