org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException

Spring JIRA | Philippe Mouawad | 5 years ago
  1. 0

    Integrating with Spring Flex, I defined a custom Login Command, like this. <beans:bean id="myLoginCommand" class="com.lyreco.sfm.security.CustomLoginCommand" > <beans:constructor-arg ref="_authenticationManager" /> </beans:bean> Analyzing I think it is due to this line of Code in SecurityConfigurationPostProcessor: boolean invalidateHttpSession = (Boolean) beanDefinition.getAttribute("invalidateHttpSession"); As invalidateHttpSession is not defined, it is null so casting to boolean throws NPE I get a NPE: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedSet(BeanDefinitionValueResolver.java:365) at org.springframework.beans.factory.support.B.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 55 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:803) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:493) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 67 more Caused by: java.lang.NullPointerException at org.springframework.flex.security3.SecurityConfigurationPostProcessor.postProcessMergedBeanDefinition(SecurityConfigurationPostProcessor.java:86) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:798) ... 74 more

    Spring JIRA | 5 years ago | Philippe Mouawad
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException
  2. 0

    Integrating with Spring Flex, I defined a custom Login Command, like this. <beans:bean id="myLoginCommand" class="com.lyreco.sfm.security.CustomLoginCommand" > <beans:constructor-arg ref="_authenticationManager" /> </beans:bean> Analyzing I think it is due to this line of Code in SecurityConfigurationPostProcessor: boolean invalidateHttpSession = (Boolean) beanDefinition.getAttribute("invalidateHttpSession"); As invalidateHttpSession is not defined, it is null so casting to boolean throws NPE I get a NPE: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedSet(BeanDefinitionValueResolver.java:365) at org.springframework.beans.factory.support.B.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 55 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:803) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:493) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 67 more Caused by: java.lang.NullPointerException at org.springframework.flex.security3.SecurityConfigurationPostProcessor.postProcessMergedBeanDefinition(SecurityConfigurationPostProcessor.java:86) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:798) ... 74 more

    Spring JIRA | 5 years ago | Philippe Mouawad
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException
  3. 0

    Following the documentation for integration AppFuse results in errors: ERROR [http-8080-1] ContextLoader.initWebApplicationContext(215) | Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecurityInterceptor': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot create inner bean '(inner bean)' of type [com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider] while setting bean property 'providers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdUserDetailsService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserDetailsService' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdGroupMembershipManager' while setting bean property 'groupMembershipManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdGroupMembershipManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) . . . The doc in question is: http://confluence.atlassian.com/display/CROWD/Integrating+AppFuse+-+a+Crowd-Spring+Security+Integration+Tutorial

    Atlassian JIRA | 8 years ago | David Yu
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecurityInterceptor': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot create inner bean '(inner bean)' of type [com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider] while setting bean property 'providers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdUserDetailsService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserDetailsService' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdGroupMembershipManager' while setting bean property 'groupMembershipManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdGroupMembershipManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Following the documentation for integration AppFuse results in errors: ERROR [http-8080-1] ContextLoader.initWebApplicationContext(215) | Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecurityInterceptor': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot create inner bean '(inner bean)' of type [com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider] while setting bean property 'providers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdUserDetailsService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserDetailsService' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdGroupMembershipManager' while setting bean property 'groupMembershipManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdGroupMembershipManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) . . . The doc in question is: http://confluence.atlassian.com/display/CROWD/Integrating+AppFuse+-+a+Crowd-Spring+Security+Integration+Tutorial

    Atlassian JIRA | 8 years ago | David Yu
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodSecurityInterceptor': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot create inner bean '(inner bean)' of type [com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider] while setting bean property 'providers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdUserDetailsService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdUserDetailsService' defined in ServletContext resource [/WEB-INF/security.xml]: Cannot resolve reference to bean 'crowdGroupMembershipManager' while setting bean property 'groupMembershipManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'crowdGroupMembershipManager' defined in class path resource [applicationContext-CrowdClient.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
  6. 0

    Enabling global-method-security with JPA @PersistenceContext annotations will fail on startup. This is with the recent 2.0.0 release cut. My userDetailsService is a custom implementation that requires access to an @Repository bean with an EntityManager. <sec:http auto-config="true"> <sec:intercept-url pattern="/assets/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <sec:intercept-url pattern="/login*" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <sec:intercept-url pattern="/logout*" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <sec:intercept-url pattern="/unsupported*" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <sec:intercept-url pattern="/password-*" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <sec:intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN"/> <sec:form-login login-page="/login.html" default-target-url="/app.html" authentication-failure-url="?login_error=1"/> <sec:logout logout-success-url="/logout.html"/> </sec:http> <sec:authentication-provider user-service-ref="userDetailsService"> <sec:password-encoder ref="passwordEncoder" /> </sec:authentication-provider> <sec:global-method-security secured-annotations="enabled" /> The exception: 2008-04-15 04:50:26,490 ERROR [main] org.springframework.web.context.ContextLoader: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServicesInjectionBeanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [epicenter-webapp-beans.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheManager' defined in class path resource [epicenter-repository-beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodDefinitionSourceAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot resolve reference to bean 'org.springframework.security.providers.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.providers.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionRepository': Injection of persistence fields failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881) at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:606) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)

    Spring JIRA | 9 years ago | Steve Kondik
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServicesInjectionBeanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [epicenter-webapp-beans.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheManager' defined in class path resource [epicenter-repository-beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_methodDefinitionSourceAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean '_authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_authenticationManager': Cannot resolve reference to bean 'org.springframework.security.providers.dao.DaoAuthenticationProvider#0' while setting bean property 'providers' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.providers.dao.DaoAuthenticationProvider#0': Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'permissionRepository': Injection of persistence fields failed; nested exception is java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.beans.factory.BeanCreationException

      Error creating bean with name '_messageBroker': Cannot resolve reference to bean 'org.springframework.flex.core.LoginCommandConfigProcessor#0' while setting bean property 'configProcessors' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.flex.core.LoginCommandConfigProcessor#0': Cannot resolve reference to bean 'myLoginCommand' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myLoginCommand' defined in ServletContext resource [/WEB-INF/flex-security.xml]: Post-processing failed of bean type [class com.lyreco.sfm.security.CustomLoginCommand] failed; nested exception is java.lang.NullPointerException

      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference()
    2. Spring Beans
      BeanDefinitionValueResolver.resolveManagedSet
      1. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
      2. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
      3. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedSet(BeanDefinitionValueResolver.java:365)
      3 frames