org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPullRequestNotificationListener' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Cannot resolve reference to bean 'pullRequestBatchNotificationDao' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext.

tip

Mixed JpaTransactionManager with JTA transaction type in the beans.xml and persistence.xml

tip

Upgrade to Confluence 3.5.5 or install the patch as explained in the details.

tip

Spring Security detects beans in the root context. Move the detection of the bean (or declare it explictly) in the root context.

tip

Your applicationcontext.xml has a transactionManager defined. Your would need to remove it or add an entity manager.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • On startup, {{EventListenerBeanRegistrar}} sometimes triggers errors like {noformat} 2015-12-02 10:41:18,111 WARN  [spring-startup]  c.a.s.i.p.OsgiBundledPathScanner Cannot scan directory /com/atlassian/oauth/shared/servlet/ in bundle com.atlassian.oauth.atlassian-oauth-service-provider-plugin as it does not exist 2015-12-02 10:55:42,505 WARN  [ThreadPoolAsyncTaskExecutor::Thread 10]  o.s.b.f.s.DisposableBeanAdapter Invocation of destroy method 'destroy' failed on bean with name 'batchNotificationJob': java.lang.IllegalStateException: Invalid BundleContext. 2015-12-02 10:55:42,517 ERROR [ThreadPoolAsyncTaskExecutor::Thread 10]  o.s.o.e.i.a.ContextLoaderListener Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.stash.notification, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPullRequestNotificationListener' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Cannot resolve reference to bean 'pullRequestBatchNotificationDao' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext.         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) ~[spring-2.5.6.SEC03-atlassian-6.jar:4.1.6.RELEASE]         at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_45]         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]         ... 20 frames trimmed Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) ~[spring-2.5.6.SEC03-atlassian-6.jar:4.1.6.RELEASE]         at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_45]         ... 5 common frames omitted Caused by: java.lang.IllegalStateException: Invalid BundleContext.         at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:457) ~[org.apache.felix.framework-3.2.2.jar:na]         at com.atlassian.stash.plugin.util.EventListenerBeanRegistrar.registerIfEventListener(EventListenerBeanRegistrar.java:84) ~[na:na]         at com.atlassian.stash.plugin.util.EventListenerBeanRegistrar.postProcessBeforeInitialization(EventListenerBeanRegistrar.java:68) ~[na:na]         ... 6 common frames omitted {noformat} This appears to be because the {{eventListener}} OSGI service isn't available (yet). This can be avoided by using a {{ServiceTracker}} instead of a simple injected service. This would likely also solve the problem described in https://confluence.atlassian.com/display/STASHKB/SSH+Server+doesn't+start
    via by Michael Heemskerk,
  • On startup, {{EventListenerBeanRegistrar}} sometimes triggers errors like {noformat} 2015-12-02 10:41:18,111 WARN  [spring-startup]  c.a.s.i.p.OsgiBundledPathScanner Cannot scan directory /com/atlassian/oauth/shared/servlet/ in bundle com.atlassian.oauth.atlassian-oauth-service-provider-plugin as it does not exist 2015-12-02 10:55:42,505 WARN  [ThreadPoolAsyncTaskExecutor::Thread 10]  o.s.b.f.s.DisposableBeanAdapter Invocation of destroy method 'destroy' failed on bean with name 'batchNotificationJob': java.lang.IllegalStateException: Invalid BundleContext. 2015-12-02 10:55:42,517 ERROR [ThreadPoolAsyncTaskExecutor::Thread 10]  o.s.o.e.i.a.ContextLoaderListener Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.stash.notification, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPullRequestNotificationListener' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Cannot resolve reference to bean 'pullRequestBatchNotificationDao' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext.         at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) ~[spring-2.5.6.SEC03-atlassian-6.jar:4.1.6.RELEASE]         at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_45]         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) ~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]         ... 20 frames trimmed Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) ~[spring-2.5.6.SEC03-atlassian-6.jar:4.1.6.RELEASE]         at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_45]         ... 5 common frames omitted Caused by: java.lang.IllegalStateException: Invalid BundleContext.         at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:457) ~[org.apache.felix.framework-3.2.2.jar:na]         at com.atlassian.stash.plugin.util.EventListenerBeanRegistrar.registerIfEventListener(EventListenerBeanRegistrar.java:84) ~[na:na]         at com.atlassian.stash.plugin.util.EventListenerBeanRegistrar.postProcessBeforeInitialization(EventListenerBeanRegistrar.java:68) ~[na:na]         ... 6 common frames omitted {noformat} This appears to be because the {{eventListener}} OSGI service isn't available (yet). This can be avoided by using a {{ServiceTracker}} instead of a simple injected service. This would likely also solve the problem described in https://confluence.atlassian.com/display/STASHKB/SSH+Server+doesn't+start
    via by Michael Heemskerk,
    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPullRequestNotificationListener' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Cannot resolve reference to bean 'pullRequestBatchNotificationDao' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pullRequestBatchNotificationDao' defined in URL [bundle://84.0:0/META-INF/spring/atlassian-plugin-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Invalid BundleContext. at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)[spring-2.5.6.SEC03-atlassian-6.jar:4.1.6.RELEASE] at java.security.AccessController.doPrivileged(Native Method)[na:1.8.0_45] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_45] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_45]

    Users with the same issue

    poroszd
    poroszd1 times, last one,
    abrazeneb
    abrazeneb34 times, last one,
    Piz
    Piz9 times, last one,
    esaar
    esaar2 times, last one,
    haerick
    haerick4 times, last one,
    59 more bugmates