java.lang.IllegalStateException: Could not register object [org.kie.scanner.KieRepositoryScannerImpl@65e8dc1a] under bean name 'ks-releaseId#scanner': there is already object [org.kie.scanner.KieRepositoryScannerImpl@1aca633b] bound

Google Groups | 段军卫 | 11 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    java.lang.IllegalStateException: Could not register object [org.kie.scanner.KieRepositoryScannerImpl

    Google Groups | 11 months ago | 段军卫
    java.lang.IllegalStateException: Could not register object [org.kie.scanner.KieRepositoryScannerImpl@65e8dc1a] under bean name 'ks-releaseId#scanner': there is already object [org.kie.scanner.KieRepositoryScannerImpl@1aca633b] bound
  2. 0

    [Thanks to Baruch for his original forum post related to this issue at http://forum.springframework.org/showthread.php?p=185875] Running the following test produces the stack trace below: public class ResourceBundlesBugTests { public @Test void test() { JavaConfigApplicationContext ctx = new JavaConfigApplicationContext(Config1.class, Config2.class); assertThat(ctx.getBean(TestBean.class).getName(), equalTo("foo")); } @ResourceBundles("issues/config1") public static class Config1 { public @Bean Object bar() { return new Object(); } } @ResourceBundles("issues/config2") public static class Config2 { public @Bean TestBean foo() { return new TestBean("foo"); } } } Cause: Line 134 of ConfigurationModelBeanDefinitionReader registers a new singleton named valueSource without checking to see if it already exists. -- Error Log from JUnit -- Class: issues.ResourceBundlesBugTests Method: test Actual: null Expected: null Stack Trace: java.lang.IllegalStateException: Could not register object [org.springframework.config.java.valuesource.MessageSourceValueSource@3d4c49] under bean name 'valueSource': there is already object [org.springframework.config.java.valuesource.MessageSourceValueSource@5b5783] bound at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:123) at org.springframework.config.java.internal.factory.support.ConfigurationModelBeanDefinitionReader.loadBeanDefinitionsForResourceBundles(ConfigurationModelBeanDefinitionReader.java:137) at org.springframework.config.java.internal.factory.support.ConfigurationModelBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationModelBeanDefinitionReader.java:87) at org.springframework.config.java.internal.factory.support.ConfigurationModelBeanDefinitionReader.loadBeanDefinitions(ConfigurationModelBeanDefinitionReader.java:73) at org.springframework.config.java.internal.factory.support.AbstractJavaConfigBeanDefinitionReader.loadBeanDefinitionsFromModel(AbstractJavaConfigBeanDefinitionReader.java:76) at org.springframework.config.java.internal.factory.support.AbstractJavaConfigBeanDefinitionReader.loadBeanDefinitions(AbstractJavaConfigBeanDefinitionReader.java:54) at org.springframework.config.java.internal.process.InternalConfigurationPostProcessor.parseAnyConfigurationClasses(InternalConfigurationPostProcessor.java:104) at org.springframework.config.java.internal.process.InternalConfigurationPostProcessor.postProcessBeanFactory(InternalConfigurationPostProcessor.java:56) at org.springframework.config.java.context.JavaConfigApplicationContext.invokeBeanFactoryPostProcessors(JavaConfigApplicationContext.java:85) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:363) at org.springframework.config.java.context.JavaConfigApplicationContext.<init>(JavaConfigApplicationContext.java:54) at issues.ResourceBundlesBugTests.__CLR2_3_1zi4lt36cl(ResourceBundlesBugTests.java:15) at issues.ResourceBundlesBugTests.test(ResourceBundlesBugTests.java:14) 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:585) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

    Spring JIRA | 9 years ago | Chris Beams
    java.lang.IllegalStateException: Could not register object [org.springframework.config.java.valuesource.MessageSourceValueSource@3d4c49] under bean name 'valueSource': there is already object [org.springframework.config.java.valuesource.MessageSourceValueSource@5b5783] bound
  3. 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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How can I cope with "IllegalStateException: BeanFactory not initialized or already closed"?

    Stack Overflow | 6 years ago | user569825
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  6. 0

    issues in spring petclinic applicaiton

    Stack Overflow | 4 years ago | user2216702
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c all 'refresh' before multicasting events via the context: Root WebApplicationCon text: startup date [Wed Mar 27 11:31:56 CDT 2013]; root of context hierarchy at org.springframework.context.support.AbstractApplic ationContext.getApp licationEventMulticaster(AbstractApplicationContex t.java:347) [spring-context-3. 2.2.RELEASE.jar:3.2.2.RELEASE] at org.springframework.context.support.AbstractApplic ationContext.publis hEvent(AbstractApplicationContext.java:334) [spring-context-3.2.2.RELEASE.jar:3. 2.2.RELEASE] at org.springframework.context.support.AbstractApplic ationContext.doClos e(AbstractApplicationContext.java:1049) [spring-context-3.2.2.RELEASE.jar:3.2.2. RELEASE] at org.springframework.context.support.AbstractApplic ationContext.close( AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RE LEASE] at org.springframework.web.context.ContextLoader.clos eWebApplicationCont ext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE] at org.springframework.web.context.ContextLoaderListe ner.contextDestroye d(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE] at org.apache.catalina.core.StandardContext.listenerS top(StandardContext .java:4831) [tomcat-embed-core-7.0.30.jar:7.0.30] at org.apache.catalina.core.StandardContext.stopInter nal(StandardContext .java:5478) [tomcat-embed-core-7.0.30.jar:7.0.30] at org.apache.catalina.util.LifecycleBase.stop(Lifecy cleBase.java:232) [ tomcat-embed-core-7.0.30.jar:7.0.30] at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:160) [tomcat-embed-core-7.0.30.jar:7.0.30] at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase. java:1559) [tomcat-embed-core-7.0.30.jar:7.0.30] at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase. java:1549) [tomcat-embed-core-7.0.30.jar:7.0.30] at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303) [n a:1.6.0_20] at java.util.concurrent.FutureTask.run(FutureTask.jav a:138) [na:1.6.0_20 ] at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec utor.java:886) [na:1.6.0_20] at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor .java:908) [na:1.6.0_20]

    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.kie.scanner.KieRepositoryScannerImpl@65e8dc1a] under bean name 'ks-releaseId#scanner': there is already object [org.kie.scanner.KieRepositoryScannerImpl@1aca633b] bound

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton()
    2. Spring Beans
      DefaultSingletonBeanRegistry.registerSingleton
      1. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.registerSingleton(DefaultSingletonBeanRegistry.java:124)
      1 frame
    3. org.kie.spring
      KieImportFactoryBean.postProcessBeanFactory
      1. org.kie.spring.factorybeans.KieImportFactoryBean.registerKieBases(KieImportFactoryBean.java:129)
      2. org.kie.spring.factorybeans.KieImportFactoryBean.postProcessBeanFactory(KieImportFactoryBean.java:108)
      2 frames
    4. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:640)
      2. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
      3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
      3 frames
    5. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      3 frames
    6. Glassfish Core
      ContainerBase$StartChild.call
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
      5. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
      5 frames
    7. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:166)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      5. java.lang.Thread.run(Thread.java:722)
      5 frames