简体   繁体   中英

No bean named 'parserPool' is defined spring security

while integrating Spring Security SAML Extension with sso getting No bean named 'parserPool' is defined spring security error

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metadata' defined in ServletContext resource [/WEB-INF/spring-config/spring-security.xml]: Cannot create inner bean 'org.opensaml.saml2.metadata.provider.HTTPMetadataProvider#5b357e7c' of type [org.opensaml.saml2.metadata.provider.HTTPMetadataProvider] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.opensaml.saml2.metadata.provider.HTTPMetadataProvider#5b357e7c' defined in ServletContext resource [/WEB-INF/spring-config/spring-security.xml]: Cannot resolve reference to bean 'parserPool' while setting bean property 'parserPool'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'parserPool' is defined

add

 @Bean(initMethod = "initialize")
 public StaticBasicParserPool parserPool() {
      return new StaticBasicParserPool();
 }

I don't do xml configuration but I guess you can easily translate this bean declaration.

In xml just add the bean

<!-- XML parser pool needed for OpenSAML parsing -->
<bean id="parserPool" 
class="org.opensaml.xml.parse.StaticBasicParserPool"
    init-method="initialize">
    <property name="builderFeatures">
        <map>
            <entry 
key="http://apache.org/xml/features/dom/defer-node-expansion"
                value="false" />
        </map>
    </property>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM