org.springframework.beans.factory.BeanCreationException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Spring Security detects beans in the root context. Move the detection of the bean (or declare it explictly) in the root context.

tip

Mixed JpaTransactionManager with JTA transaction type in the beans.xml and persistence.xml

tip

Upgrade to Confluence 3.5.5 or install the patch as explained in the details.

tip

Your applicationcontext.xml has a transactionManager defined. Your would need to remove it or add an entity manager.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • I've been trying to get the latest source code of oauth2 to work and have paid careful attention to how the sparklr2 sample app works. I am using expressions for my {{<http:/>}} configuration and that doesn't play nicely with the configuration sparklr2 has. If you change the sparkl2 configuration to use expressions and then add hasRole() or hasAnyRole() to the configuration, it fails with: {noformat} 2011-10-25 17:10:25.495:WARN:/sparklr:unavailable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0' while setting constructor argument with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [hasAnyRole('ROLE_USER','DENY_OAUTH'), hasRole('IS_AUTHENTICATED_ANONYMOUSLY'), hasAnyRole('ROLE_CLIENT','SCOPE_TRUST'), hasAnyRole('ROLE_USER','SCOPE_TRUST'), hasRole(ROLE_USER), hasAnyRole('IS_AUTHENTICATED_ANONYMOUSLY','DENY_OAUTH'), hasAnyRole('ROLE_USER','SCOPE_READ'), hasAnyRole('ROLE_USER','SCOPE_READ')] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) {noformat} That's why it's not working for my web app either.
    via by Bjorn Harvold,
  • I've been trying to get the latest source code of oauth2 to work and have paid careful attention to how the sparklr2 sample app works. I am using expressions for my {{<http:/>}} configuration and that doesn't play nicely with the configuration sparklr2 has. If you change the sparkl2 configuration to use expressions and then add hasRole() or hasAnyRole() to the configuration, it fails with: {noformat} 2011-10-25 17:10:25.495:WARN:/sparklr:unavailable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0' while setting constructor argument with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [hasAnyRole('ROLE_USER','DENY_OAUTH'), hasRole('IS_AUTHENTICATED_ANONYMOUSLY'), hasAnyRole('ROLE_CLIENT','SCOPE_TRUST'), hasAnyRole('ROLE_USER','SCOPE_TRUST'), hasRole(ROLE_USER), hasAnyRole('IS_AUTHENTICATED_ANONYMOUSLY','DENY_OAUTH'), hasAnyRole('ROLE_USER','SCOPE_READ'), hasAnyRole('ROLE_USER','SCOPE_READ')] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) {noformat} That's why it's not working for my web app either.
    via by Bjorn Harvold,
  • Spring bean creation error
    via Stack Overflow by congalong
    ,
  • Spring context scanning behavior
    via Stack Overflow by Simeon Leyzerzon
    ,
    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0' while setting constructor argument with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [hasAnyRole('ROLE_USER','DENY_OAUTH'), hasRole('IS_AUTHENTICATED_ANONYMOUSLY'), hasAnyRole('ROLE_CLIENT','SCOPE_TRUST'), hasAnyRole('ROLE_USER','SCOPE_TRUST'), hasRole(ROLE_USER), hasAnyRole('IS_AUTHENTICATED_ANONYMOUSLY','DENY_OAUTH'), hasAnyRole('ROLE_USER','SCOPE_READ'), hasAnyRole('ROLE_USER','SCOPE_READ')] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)

    Users with the same issue

    abrazeneb
    34 times, last one,
    Piz
    9 times, last one,
    esaar
    2 times, last one,
    haerick
    4 times, last one,
    Kawada
    5 times, last one,
    59 more bugmates