java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound

Spring JIRA | Stepan Koltsov | 3 years ago
  1. 0

    spring-boot sample project fails to start if source jar is in classpath

    GitHub | 3 years ago | philwebb
    java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound
  2. 0

    If spring-boot-autoconfigure source jar is added to classpath along with spring-boot-autoconfigure binary jar, spring-boot sample project fails to start with hard to understand error message: {code} Exception in thread "main" java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:129) at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerSingleton(DefaultListableBeanFactory.java:778) at org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer.initialize(AutoConfigurationReportLoggingInitializer.java:60) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:403) at org.springframework.boot.SpringApplication.run(SpringApplication.java:287) at org.springframework.boot.SpringApplication.run(SpringApplication.java:749) at org.springframework.boot.SpringApplication.run(SpringApplication.java:738) at ru.yandex.salmon.SalmonMain.main(SalmonMain.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:491) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {code} It fails due to the fact that spring.factories of spring-boot-configuration is added twice to the classpath. This problem is easy to detect: if two objects of the same type added to SpringApplication.initializers, then spring-boot should either: * print nice diagnostics message * or just quietly ignore second initializer

    Spring JIRA | 3 years ago | Stepan Koltsov
    java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound
  3. 0

    If spring-boot-autoconfigure source jar is added to classpath along with spring-boot-autoconfigure binary jar, spring-boot sample project fails to start with hard to understand error message: {code} Exception in thread "main" java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:129) at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerSingleton(DefaultListableBeanFactory.java:778) at org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer.initialize(AutoConfigurationReportLoggingInitializer.java:60) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:403) at org.springframework.boot.SpringApplication.run(SpringApplication.java:287) at org.springframework.boot.SpringApplication.run(SpringApplication.java:749) at org.springframework.boot.SpringApplication.run(SpringApplication.java:738) at ru.yandex.salmon.SalmonMain.main(SalmonMain.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:491) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {code} It fails due to the fact that spring.factories of spring-boot-configuration is added twice to the classpath. This problem is easy to detect: if two objects of the same type added to SpringApplication.initializers, then spring-boot should either: * print nice diagnostics message * or just quietly ignore second initializer

    Spring JIRA | 3 years ago | Stepan Koltsov
    java.lang.IllegalStateException: Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem with KIE Scanner

    Google Groups | 2 years ago | Zelimir Koljesar
    java.lang.IllegalStateException: Could not register object [org.kie.scanner.KieRepositoryScannerImpl@587c7377] under bean name 'drools-rules-import#scanner': there is already object [org.kie.scanner.KieRepositoryScannerImpl@587c7377] bound
  6. 0

    Error in shop-admin-javafx example since 3.0.3.GA upgrade

    Google Groups | 3 years ago | Stephen Ross
    java.lang.IllegalStateException: Could not register object [org.granite.client.tide.spring.SpringEventBus@35b102dd] under bean name 'eventBus': there is already object [org.granite.client.tide.spring.SpringEventBus@35b102dd] bound
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

    Could not register object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@2fd6b6c7] under bean name 'autoConfigurationReportLogger': there is already object [org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer$AutoConfigurationReportLogger@5bfa9431] bound

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton()
  2. Spring Beans
    DefaultListableBeanFactory.registerSingleton
    1. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:129)
    2. org.springframework.beans.factory.support.DefaultListableBeanFactory.registerSingleton(DefaultListableBeanFactory.java:778)
    2 frames
  3. Spring Boot AutoConfigure
    AutoConfigurationReportLoggingInitializer.initialize
    1. org.springframework.boot.autoconfigure.AutoConfigurationReportLoggingInitializer.initialize(AutoConfigurationReportLoggingInitializer.java:60)
    1 frame
  4. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:403)
    2. org.springframework.boot.SpringApplication.run(SpringApplication.java:287)
    3. org.springframework.boot.SpringApplication.run(SpringApplication.java:749)
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:738)
    4 frames
  5. ru.yandex.salmon
    SalmonMain.main
    1. ru.yandex.salmon.SalmonMain.main(SalmonMain.java:22)
    1 frame
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:491)
    4 frames
  7. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    1 frame