Spring Security
  1. Spring Security
  2. SEC-1565

You cannot use a spring-security-2.0.xsd schema with Spring Security 3.0 using spring-security-3.0.3.xsd

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.1.0.M2
    • Component/s: Namespace
    • Labels:
      None
    • Environment:
      Eclipse 3.5.2
      MyEclipse 8.6
      Java 1.6.0_20-b02-279-10M3065
      OS X 10.6.4.

      Description

      I'm getting the following error in Eclipse when referencing the spring-security-3.0.3.xsd schema:

      You cannot use a spring-security-2.0.xsd schema with Spring Security 3.0. Please update your schema declarations to the 3.0 schema.

      /myproject/web/WEB-INF/spring-security.xml line 8 Spring Beans Problem

      Per the docs at http://static.springsource.org/spring-security/site/docs/3.0.x/reference/springsecurity-single.html#d0e344 as referenced on 2010-09-07 my config looks like:

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
      	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      	http://www.springframework.org/schema/security
      	http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
      
      	<security:http auto-config="true">
      		<security:intercept-url pattern="/**" access="ROLE_USER"/>
      	</security:http>
      </beans>
      

      From a quick glance at the SecurityNamespaceHandler source I would think the first "(?m).spring-security-3
      .0.*xsd.
      " regex would match, but I'm not currently setup to debug Eclipse itself to see if there is something else going on. Oddly enough if I change to "spring-security-3.0.xsd" and clean the project the error goes away:

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security"
      	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
      	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      	http://www.springframework.org/schema/security
      	http://www.springframework.org/schema/security/spring-security-3.0.xsd">
      
      	<security:http auto-config="true">
      		<security:intercept-url pattern="/**" access="ROLE_USER"/>
      	</security:http>
      </beans>
      

        Activity

        Hide
        Ian Brandt added a comment -

        Hmm, looks like you don't support the JIRA wiki syntax I'm used to, and I also can't seem to edit my own issue, so my apologies for the formatting issues in the description above.

        Show
        Ian Brandt added a comment - Hmm, looks like you don't support the JIRA wiki syntax I'm used to, and I also can't seem to edit my own issue, so my apologies for the formatting issues in the description above.
        Hide
        Luke Taylor added a comment -

        In what context is the error occurring? The eclipse editor, running a test, an application or whatever? Where does the error message occur - is there actually a stacktrace or just a message in eclipse?

        Do you get the error if you are using standard eclipse without MyEclipse? Maybe their integration has problems with the latest version?

        Show
        Luke Taylor added a comment - In what context is the error occurring? The eclipse editor, running a test, an application or whatever? Where does the error message occur - is there actually a stacktrace or just a message in eclipse? Do you get the error if you are using standard eclipse without MyEclipse? Maybe their integration has problems with the latest version?
        Hide
        Rob Winch added a comment -

        Just out of curiosity what version of spring-security-config are you using? I believe I have seen users with this issue on the forums. The issue I am thinking of occurs when loading a Spring config using spring-security-config-[3.0,3.0.2].jar and specifying a spring-security namespace of 3.0.3. The validation of the schema version was updated in 3.0.3 to allow for 3.0.x vs 3.0. This update did not occur till then because there were no 3.0.1 and 3.0.2 versions of the schema.

        If this is the problem you are encountering, you can fix it by doing one of the following:

        1) Upgrade to spring-security-config-3.0.3.jar
        2) Change the namespace declaration to be 3.0

        Show
        Rob Winch added a comment - Just out of curiosity what version of spring-security-config are you using? I believe I have seen users with this issue on the forums. The issue I am thinking of occurs when loading a Spring config using spring-security-config- [3.0,3.0.2] .jar and specifying a spring-security namespace of 3.0.3. The validation of the schema version was updated in 3.0.3 to allow for 3.0.x vs 3.0. This update did not occur till then because there were no 3.0.1 and 3.0.2 versions of the schema. If this is the problem you are encountering, you can fix it by doing one of the following: 1) Upgrade to spring-security-config-3.0.3.jar 2) Change the namespace declaration to be 3.0
        Hide
        Ian Brandt added a comment -

        Thanks for the comments. After some digging it looks like this is a MyEclipse issue, so feel free to resolve as invalid. I'll take this up on the MyEclipse forums.

        For anyone else that runs into this here were my findings... The context is in the Eclipse Problems view related to the Spring Beans Project Validators. Just a message, no stack trace. When I run my webapp everything works fine. It looks like MyEclipse 8.6 is using Spring Security 3.0.1 internally dor validation. I do have 3.0.3 in the build path for my project. If I check "Project Properties > MyEclipse > Spring > Beans > Load NamespaceHandlers and XSDs from project's classpath [Experimental]" I can refer to the 3.0.3 XSD without a validation Error. Though then with the config above I do get a warning in the Problems view, "Referenced bean 'org.springframework.security.core.userdetails.memory.InMemoryDaoImpl' not found". If I uncheck the option and fall back on referring to the 3.0 XSD I get a different warning, "Class 'org.springframework.security.core.userdetails.memory.UserMap' is marked deprecated". Neither is a show stopper of course, I'm just documenting them for the sake of completeness.

        Show
        Ian Brandt added a comment - Thanks for the comments. After some digging it looks like this is a MyEclipse issue, so feel free to resolve as invalid. I'll take this up on the MyEclipse forums. For anyone else that runs into this here were my findings... The context is in the Eclipse Problems view related to the Spring Beans Project Validators. Just a message, no stack trace. When I run my webapp everything works fine. It looks like MyEclipse 8.6 is using Spring Security 3.0.1 internally dor validation. I do have 3.0.3 in the build path for my project. If I check "Project Properties > MyEclipse > Spring > Beans > Load NamespaceHandlers and XSDs from project's classpath [Experimental] " I can refer to the 3.0.3 XSD without a validation Error. Though then with the config above I do get a warning in the Problems view, "Referenced bean 'org.springframework.security.core.userdetails.memory.InMemoryDaoImpl' not found". If I uncheck the option and fall back on referring to the 3.0 XSD I get a different warning, "Class 'org.springframework.security.core.userdetails.memory.UserMap' is marked deprecated". Neither is a show stopper of course, I'm just documenting them for the sake of completeness.
        Hide
        Luke Taylor added a comment -

        Thanks for investigating further. Closing as requested.

        Show
        Luke Taylor added a comment - Thanks for investigating further. Closing as requested.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Ian Brandt
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: