org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'confluencePluginEnabler' defined in URL [bundle://80.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence

Atlassian JIRA | Fabian Krämer | 6 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Confluence theme plugin can fail to come up. Seen in build: https://bamboo.extranet.atlassian.com/browse/JST-JST-JOBE-787 Confluence log shows: {noformat} 2011-08-30 20:12:25,573 ERROR [Spring executor 9] [plugin.osgi.factory.OsgiPlugin] onSpringContextFailed Unable to start the Spring context for plugin com.atlassian.studio.confluence.common org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'confluencePluginEnabler' defined in URL [bundle://80.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) 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:222) 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.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enablePlugin(ConfluencePluginEnabler.java:61) at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enableCorrectConfluencePlugin(ConfluencePluginEnabler.java:52) at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.afterPropertiesSet(ConfluencePluginEnabler.java:37) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 19 more {noformat} Immediately after calling pluginController.enablePlugins(), ConfluencePluginEnabler checks pluginAccessor.isPluginEnabled(): {code:java} private void enablePlugin(String pluginKey) { pluginController.enablePlugins(pluginKey); if (!pluginAccessor.isPluginEnabled(pluginKey)) { throw new IllegalStateException("Could not enable plugin" + pluginKey); } log.info("Enabled plugin " + pluginKey); } {code} This check verifies the plugin state, which seems to be set synchronously via the enablePlugins() call. Therefore, a theory is that another thread is disabling the plugin at the same time. There is no evidence of this in the logs, and there appears to be no logging at the Felix level for the events of interest (in {{org.apache.felix.framework.Felix.stopBundle(BundleImpl, boolean)}}). If this re-occurs: * Verify that the enablePlugins() call, when running in conjunction with {{ConfluencePluginManager}}, does indeed behave synchronously. Note that {{ConfluencePluginManager}} does not set the plugin state directly, but listens for an {{ApplicationEvent}} (see {{com.atlassian.confluence.event.ConfluenceEventPublisherManager.publish(Object)}}), which delegates to org.springframework.context.ApplicationContext. From the [Spring doc|http://static.springsource.org/spring/docs/3.1.0.M2/spring-framework-reference/html/beans.html#context-functionality-events]: "You may register as many event listeners as you wish, but note that *by default event listeners receive events synchronously*." - so it *could* be asynchronous. * Consider implementing a {{BundleListener}} that logs for OSGi events to give us more information about who could be disabling the plugin and why. This logging {{BundleListener}} will not be enabled in time if registerd via Spring DM - it must be enabled via {{BundleActivator}}.

    Atlassian JIRA | 6 years ago | Fabian Krämer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'confluencePluginEnabler' defined in URL [bundle://80.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence
  2. 0

    Confluence theme plugin can fail to come up. Seen in build: https://bamboo.extranet.atlassian.com/browse/JST-JST-JOBE-787 Confluence log shows: {noformat} 2011-08-30 20:12:25,573 ERROR [Spring executor 9] [plugin.osgi.factory.OsgiPlugin] onSpringContextFailed Unable to start the Spring context for plugin com.atlassian.studio.confluence.common org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'confluencePluginEnabler' defined in URL [bundle://80.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) 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:222) 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.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enablePlugin(ConfluencePluginEnabler.java:61) at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enableCorrectConfluencePlugin(ConfluencePluginEnabler.java:52) at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.afterPropertiesSet(ConfluencePluginEnabler.java:37) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 19 more {noformat} Immediately after calling pluginController.enablePlugins(), ConfluencePluginEnabler checks pluginAccessor.isPluginEnabled(): {code:java} private void enablePlugin(String pluginKey) { pluginController.enablePlugins(pluginKey); if (!pluginAccessor.isPluginEnabled(pluginKey)) { throw new IllegalStateException("Could not enable plugin" + pluginKey); } log.info("Enabled plugin " + pluginKey); } {code} This check verifies the plugin state, which seems to be set synchronously via the enablePlugins() call. Therefore, a theory is that another thread is disabling the plugin at the same time. There is no evidence of this in the logs, and there appears to be no logging at the Felix level for the events of interest (in {{org.apache.felix.framework.Felix.stopBundle(BundleImpl, boolean)}}). If this re-occurs: * Verify that the enablePlugins() call, when running in conjunction with {{ConfluencePluginManager}}, does indeed behave synchronously. Note that {{ConfluencePluginManager}} does not set the plugin state directly, but listens for an {{ApplicationEvent}} (see {{com.atlassian.confluence.event.ConfluenceEventPublisherManager.publish(Object)}}), which delegates to org.springframework.context.ApplicationContext. From the [Spring doc|http://static.springsource.org/spring/docs/3.1.0.M2/spring-framework-reference/html/beans.html#context-functionality-events]: "You may register as many event listeners as you wish, but note that *by default event listeners receive events synchronously*." - so it *could* be asynchronous. * Consider implementing a {{BundleListener}} that logs for OSGi events to give us more information about who could be disabling the plugin and why. This logging {{BundleListener}} will not be enabled in time if registerd via Spring DM - it must be enabled via {{BundleActivator}}.

    Atlassian JIRA | 6 years ago | Fabian Krämer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'confluencePluginEnabler' defined in URL [bundle://80.0:0/META-INF/spring/atlassian-plugins-components.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Could not enable plugincom.atlassian.studio.confluence
  3. 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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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]
  6. 0

    Porting project JBoss AS 6 to JBoss AS 7

    Stack Overflow | 5 years ago | Rounak
    java.lang.IllegalStateException: Application was not properly initialize d at startup, could not find Factory: javax.faces.application.ApplicationFactory at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.jav a:894) [jsf-api.jar:] at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:319) [jsf-api .jar:] at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext .java:112) [jsf-impl.jar:] at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureList ener.java:325) [jsf-impl.jar:] at org.apache.catalina.core.StandardContext.listenerStop(StandardContext .java:3465) [jbossweb-7.0.1.Final.jar:7.0.2.Final] at org.apache.catalina.core.StandardContext.stop(StandardContext.java:39 70) [jbossweb-7.0.1.Final.jar:7.0.2.Final] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3 888) [jbossweb-7.0.1.Final.jar:7.0.2.Final] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentS ervice.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se rviceControllerImpl.java:1824) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont rollerImpl.java:1759) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1110) [:1.7.0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:603) [:1.7.0]

    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 enable plugincom.atlassian.studio.confluence

      at com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enablePlugin()
    2. com.atlassian.studio
      ConfluencePluginEnabler.afterPropertiesSet
      1. com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enablePlugin(ConfluencePluginEnabler.java:61)
      2. com.atlassian.studio.confluence.common.ConfluencePluginEnabler.enableCorrectConfluencePlugin(ConfluencePluginEnabler.java:52)
      3. com.atlassian.studio.confluence.common.ConfluencePluginEnabler.afterPropertiesSet(ConfluencePluginEnabler.java:37)
      3 frames
    3. Spring Beans
      AbstractAutowireCapableBeanFactory$1.run
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      4 frames
    4. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    5. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      2. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      3. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      7. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      7 frames
    6. Spring Context
      AbstractApplicationContext.finishBeanFactoryInitialization
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
      1 frame
    7. Spring OSGi Core
      AbstractDelegatedExecutionApplicationContext.completeRefresh
      1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
      2. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
      3. org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
      4. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
      4 frames
    8. org.springframework.osgi
      DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run
      1. org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
      1 frame
    9. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      3. java.lang.Thread.run(Thread.java:662)
      3 frames