Skip to content

BeanDefinitionParsingException when using spring-security-5.7.xsd with Spring Security 5.7 #11332

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

Closed
in-fke opened this issue Jun 3, 2022 · 3 comments
Assignees
Labels
in: config An issue in spring-security-config

Comments

@in-fke
Copy link

in-fke commented Jun 3, 2022

Describe the bug
BeanDefinitionParsingException when using spring-security-5.6.xsd with Spring Security 5.7

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema with Spring Security 5.7. Please update your schema declarations to the 5.7 schema.
Offending resource: class path resource [web-security.xml]

Related to #8974 ?

To Reproduce
XML Bean Definition with header

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
	   http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security-5.7.xsd
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
       http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util-4.3.xsd">

Tried with 5.6 and 5.7 - and on Jetty (with Internet access) - it work, but not on a Tomcat (relevant?).

Reverting to (omitting the version) seems to help:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
	   http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security.xsd
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
       http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util-4.3.xsd">

Note that there is (as of June 3rd) no 5.7 here:
http://www.springframework.org/schema/security/

Expected behavior
Expecting a correct error message or no error.

Sample

Cannot provide a sample - sorry.

@in-fke in-fke added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jun 3, 2022
@rwinch rwinch added this to the 5.7.2 milestone Jun 3, 2022
@jgrandja
Copy link
Contributor

jgrandja commented Jun 17, 2022

@in-fke

BeanDefinitionParsingException when using spring-security-5.6.xsd with Spring Security 5.7

If you're using Spring Security 5.7 then you should point to spring-security-5.7.xsd. The error caused by pointing to spring-security-5.6.xsd may be related to attributes/elements added in 5.7 that the BeanDefinitionParser is expecting.

Note that there is (as of June 3rd) no 5.7 here:

It is there now http://www.springframework.org/schema/security/spring-security-5.7.xsd
Can you please try this again on your end?

FYI, http://www.springframework.org/schema/security/spring-security.xsd always points to the latest schema so in this case it's 5.7.

@jgrandja jgrandja removed this from the 5.7.2 milestone Jun 17, 2022
@jgrandja jgrandja added status: waiting-for-feedback We need additional information before we can continue in: config An issue in spring-security-config and removed status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jun 17, 2022
@in-fke
Copy link
Author

in-fke commented Jun 21, 2022

Can you please try this again on your end?

I had tried this initially (with 5.7) - I will not have the time to test again, unfortunately.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 21, 2022
@jgrandja
Copy link
Contributor

jgrandja commented Jun 21, 2022

@in-fke Closing this as resolved since https://www.springframework.org/schema/security/spring-security-5.7.xsd is in the expected location.

@jgrandja jgrandja removed the status: feedback-provided Feedback has been provided label Jun 21, 2022
@jgrandja jgrandja self-assigned this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: config An issue in spring-security-config
Projects
None yet
Development

No branches or pull requests

4 participants