Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML bean singleton attribute silently ignored [SPR-12167] #16781

Closed
spring-projects-issues opened this issue Sep 9, 2014 · 4 comments
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 9, 2014

Alexander Kudrevatykh opened SPR-12167 and commented

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.


Affects: 4.0.6

Issue Links:

Backported to: 4.0.8

@spring-projects-issues
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

<!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.

@spring-projects-issues
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants