Results 1 to 3 of 3

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

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Location
    Toronto, Canada
    Posts
    2

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    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:
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jan 2011
    Location
    Toronto, Canada
    Posts
    2

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •