Announcement Announcement Module
Collapse
No announcement yet.
Samples Tutorial applicationContext-security.xml results in XML errors Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Samples Tutorial applicationContext-security.xml results in XML errors

    I am using the samples Tutorial applicationContext-security.xml which gives following error at each & every tag definition

    Code:
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.
    
    Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 14 in XML document from class path resource [applicationContext-acegi-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:190)
    	... 41 more
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'.
    Here is the file
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!--
      - Sample namespace-based configuration
      -
      - $Id: applicationContext-security.xml 3019 2008-05-01 17:51:48Z luke_t $
      -->
    
    <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"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                            http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">
    
    	
    
        <http auto-config="true">
            <intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
            <intercept-url pattern="/secure/**" access="IS_AUTHENTICATED_REMEMBERED" />
    		<!-- Disable web URI authorization, as we're using <global-method-security> and have @Secured the services layer instead
            <intercept-url pattern="/listAccounts.html" access="IS_AUTHENTICATED_REMEMBERED" />
            <intercept-url pattern="/post.html" access="ROLE_TELLER" />
            -->
            <intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
    <!--
        Uncomment to enable X509 client authentication support
            <x509 /> 
    -->
    
            <!-- All of this is unnecessary if auto-config="true"
            <form-login />
            <anonymous />
            <http-basic />
            <logout />
            <remember-me /> -->
    
            <!-- Uncomment to limit the number of sessions a user can have
            <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true"/>
    		-->		
        </http>
    
        <!--
        Usernames/Passwords are
            rod/koala
            dianne/emu
            scott/wombat
            peter/opal
        -->
        <authentication-provider>
            <password-encoder hash="md5"/>
            <user-service>
                <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
    	        <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
                <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
                <user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" />
    	    </user-service>
    	</authentication-provider>
    
    </beans:beans>

  • #2
    Does the sample application run OK if you leave deploy it untouched?

    Comment


    • #3
      Does the sample application run OK if you leave deploy it untouched?
      Yes the sample application runs perfectly OK if deploy untouched

      Comment


      • #4
        Hi,

        having the same problem....

        What was the solution, please?


        thanks in advance
        Serge
        Last edited by setki; Jul 25th, 2008, 05:05 AM.

        Comment


        • #5
          Change access=&quot;ROLE_SUPERVISOR&quot;

          Hi
          I'm new using spring security and need change access="ROLE_SUPERVISOR" for access="admin" or another acces type

          Any Idea where can I find the resource used for applicationContext-securit.xml in security:intercept-url TAG.


          thanks

          Comment


          • #6
            I added the security prefix to all the tags in the http which corrected the issue.

            Martin

            Comment

            Working...
            X