Announcement Announcement Module
Collapse
No announcement yet.
the matching wildcard is strict but no declaration can be found for element 'bean' Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • the matching wildcard is strict but no declaration can be found for element 'bean'

    Hello,

    I am just getting started with Spring Security + GWT. I was following a blog from http://seewah.blogspot.com/2009/02/g...-security.html and I am getting this error due to some misconfiguration in my applicationContext.xml, but I don't know what.

    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 'bean'.:

    Here is my applicationContext.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <!--
    - Sample namespace-based configuration
    -
    -->

    <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:osgi="http://www.springframework.org/schema/osgi"
    xmlns:security="http://www.springframework.org/schema/security"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    <security:global-method-security secured-annotations="enabled" jsr250-annotations="disabled" />

    <bean id="dummyAuthenticationProvider" class="com.xxx.xxx.DummyAuthenticationProvider">
    <security:custom-authentication-provider />
    </bean>

    </beans:beans>

    I really appreciate any help with this.

    Thanks,
    Ravi

  • #2
    Use [ code][/code ] tags when posting code, that way it remains readable.

    You declared the security schema as the root schema and that does not have bean elements. YOu need to prefix everything coming from the bean schema with beans:

    Comment


    • #3
      Hi Marten,

      Thanks for quick reply. I will use in future. since this was my first post, I didn't know the convention.

      I prefixed "beans" as follows:

      Code:
          <beans:bean id="dummyAuthenticationProvider" class="com.cricwebportal.server.DummyAuthenticationProvider" >
          	<custom-authentication-provider/>
          </beans:bean>

      and I got another error saying "The matching wildcard is strict, but no declaration can be found for element 'custom-authentication-provider'.".

      and after doing some googleing I found out the custom-authentication-provider should be the child of authentication-manager.

      Here is my latest configuration:

      Code:
      <?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"
          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">
      
          <global-method-security secured-annotations="enabled" jsr250-annotations="disabled" />
          
          <beans:bean id="springSecurityFilterChain" class="org.springframework.web.filter.DelegatingFilterProxy" />
          
          <beans:bean id="dummyAuthenticationProvider" class="com.xxx.server.DummyAuthenticationProvider" />
      
          <authentication-manager>
              <authentication-provider ref='dummyAuthenticationProvider'>
              </authentication-provider>
          </authentication-manager>
          
      
      </beans:beans>

      This configuration compiles fines but haven't tested the functionality yet.

      Thanks,
      Ravi

      Comment

      Working...
      X