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

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

spring-projects-issues opened this issue Sep 9, 2014 · 4 comments
Assignees
Labels
in: core status: backported type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues 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:

  • #15070 Create v4 XML schema
  • #17433 There is no spring-beans.dtd file inside of the spring-beans-4.1.5.RELEASE jar

Backported to: 4.0.8

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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

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

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants