org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is java.lang.IllegalStateException: Cannot apply org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$EnableGlobalAuthenticationAutowiredConfigurer@1ff6fe76 to already built object

Stack Overflow | zoram | 4 months ago
  1. 0

    Spring Boot Security - java.lang.IllegalArgumentException: Cannot pass a null GrantedAuthority collection

    Stack Overflow | 4 months ago | zoram
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is java.lang.IllegalStateException: Cannot apply org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$EnableGlobalAuthenticationAutowiredConfigurer@1ff6fe76 to already built object
  2. 0

    Error to autowire AuthenticationManager inside OAuth2 configuration class

    Stack Overflow | 1 year ago | Kleber Mota
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Cannot apply JdbcUserDetailsManagerConfigurer@5a34003b to already built object | Solutions for enthusiast and professional programmers

    fatal-errors.com | 1 year ago
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
  5. 0

    getting error Cannot apply DaoAuthenticationConfigurer@6fc0592c to already built object

    Stack Overflow | 2 months ago | Dhananjay K
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Cannot apply org.springframework.security.config.annotation.authentication.configurers.userdetails.DaoAuthenticationConfigurer@6fc0592c to already built object

    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. java.lang.IllegalStateException

      Cannot apply org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$EnableGlobalAuthenticationAutowiredConfigurer@1ff6fe76 to already built object

      at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.add()
    2. org.springframework.security
      GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$4d2f982f$$FastClassBySpringCGLIB$$601d8069.invoke
      1. org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.add(AbstractConfiguredSecurityBuilder.java:195)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      2. org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.apply(AbstractConfiguredSecurityBuilder.java:146)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      3. org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration.getAuthenticationManager(AuthenticationConfiguration.java:78)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      4. org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.authenticationManager(GlobalMethodSecurityConfiguration.java:257)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      5. org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.methodSecurityInterceptor(GlobalMethodSecurityConfiguration.java:123)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      6. org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$4d2f982f.CGLIB$methodSecurityInterceptor$2(<generated>)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      7. org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$4d2f982f$$FastClassBySpringCGLIB$$601d8069.invoke(<generated>)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      7 frames
    3. Spring Core
      MethodProxy.invokeSuper
      1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[spring-core-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      1 frame
    4. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      1 frame
    5. org.springframework.security
      GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$4d2f982f.methodSecurityInterceptor
      1. org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$4d2f982f.methodSecurityInterceptor(<generated>)[spring-security-config-4.0.4.RELEASE.jar:4.0.4.RELEASE]
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_25]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_25]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_25]
      4. java.lang.reflect.Method.invoke(Method.java:483)[na:1.8.0_25]
      4 frames
    7. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      7. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      8. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      9. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      10. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      11. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)[spring-beans-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      11 frames
    8. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)[spring-context-4.2.7.RELEASE.jar:4.2.7.RELEASE]
      2 frames
    9. Spring Boot
      SpringApplication.run
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      3. org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      4. org.springframework.boot.SpringApplication.run(SpringApplication.java:306)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.3.7.RELEASE.jar:1.3.7.RELEASE]
      6 frames
    10. com.example
      SpringsecuritydemoApplication.main
      1. com.example.SpringsecuritydemoApplication.main(SpringsecuritydemoApplication.java:10)[classes/:na]
      1 frame