You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XML bean singleton attribute silently ignored [SPR-12167] #16781
in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement
In commit 2c3a8a5 support of singleton attribute was dropped
Now if xml contains that attribute it silently ignored, that can cause unexpected behavior in runtime.
I think spring should throw exception in case of such unsupported attributes.
Note that as of Spring 4.0, we dropped support for pre-2.0 DTDs entirely. And with any 2.0+ DTDs/XSDs, you don't have the 'singleton' attribute declared anymore. Are you still using an older DTD there, or did you turn off XML validation?
In any case, we can certainly throw a proper exception in such a case.
I know that support was dropped, and after migration to 2.0+ DTD/XSD validation error throwed on this attribute.
Validation is turned on, but old DTD used
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
It would be nice if any exception thrown when using such old DTDs.
When encountering the 'singleton' attribute, we are raising a parse error (turned into an exception) as of Spring Framework 4.1.1 now.
For 4.0.8, we'll just raise a parse warning since quite a few apps might work fine even with some old definition files in use, and we don't want to disrupt them that late in the branch.
in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement
Activity
spring-projects-issues commentedon Sep 9, 2014
Juergen Hoeller commented
Note that as of Spring 4.0, we dropped support for pre-2.0 DTDs entirely. And with any 2.0+ DTDs/XSDs, you don't have the 'singleton' attribute declared anymore. Are you still using an older DTD there, or did you turn off XML validation?
In any case, we can certainly throw a proper exception in such a case.
Juergen
spring-projects-issues commentedon Sep 10, 2014
Alexander Kudrevatykh commented
I know that support was dropped, and after migration to 2.0+ DTD/XSD validation error throwed on this attribute.
Validation is turned on, but old DTD used
It would be nice if any exception thrown when using such old DTDs.
spring-projects-issues commentedon Sep 17, 2014
Juergen Hoeller commented
If we choose to do something 'soft' such as log a warning, we can backport this to 4.0.8 as well.
Juergen
spring-projects-issues commentedon Sep 17, 2014
Juergen Hoeller commented
When encountering the 'singleton' attribute, we are raising a parse error (turned into an exception) as of Spring Framework 4.1.1 now.
For 4.0.8, we'll just raise a parse warning since quite a few apps might work fine even with some old definition files in use, and we don't want to disrupt them that late in the branch.
Juergen