Plugins are disabled at startup and various timeout errors appear in the logs after startup

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

When starting Confluence, some of the plugins are disabled. The following appears in the atlassian-confluence.log:

014-07-02 17:04:07,854 ERROR [Timer-8] [plugin.osgi.factory.OsgiPlugin] onPluginContainerFailed Unable to start the plugin container for plugin auiplugin-integration-sal
 -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.aui.plugin-integration-sal' has timed out
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:50)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:105)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
	
2014-07-02 17:04:07,982 ERROR [Timer-8] [extender.internal.activator.ContextLoaderListener] onOsgiApplicationEvent Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.activeobjects.activeobjects-plugin, config=osgibundle:/META-INF/spring/*.xml))
 -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
 
 
  -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
2014-07-02 17:04:34,997 ERROR [Timer-8] [plugin.osgi.factory.OsgiPlugin] logAndClearOustandingDependencies Never resolved service '&consumerTokenStore' for plugin 'com.atlassian.applinks.applinks-plugin' with filter (objectClass=com.atlassian.oauth.consumer.ConsumerTokenStore)
 -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
2014-07-02 17:04:34,998 ERROR [Timer-8] [plugin.osgi.factory.OsgiPlugin] logAndClearOustandingDependencies Never resolved service '&serviceProviderTokenStore' for plugin 'com.atlassian.applinks.applinks-plugin' with filter (objectClass=com.atlassian.oauth.serviceprovider.ServiceProviderTokenStore)
 -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
2014-07-02 17:04:34,998 ERROR [Timer-8] [plugin.osgi.factory.OsgiPlugin] logAndClearOustandingDependencies Never resolved service '&requestFactory' for plugin 'com.atlassian.applinks.applinks-plugin' with filter (objectClass=com.atlassian.sal.api.net.RequestFactory)
 -- referer: http://localhost:8090/setup/setupstandarddb.action | url: /setup/setupstandarddb.action | userName: anonymous | action: setupstandarddb
2014-07-02 17:04:34,998 ERROR [Timer-8] [plugin.osgi.factory.OsgiPlugin] logAndClearOustandingDependencies Never resolved service '&templateRenderer' for plugin 'com.atlassian.applinks.applinks-plugin' with filter (objectClass=com.atlassian.templaterenderer.TemplateRenderer)

or:

2010-01-04 16:00:09,256 INFO [main] [atlassian.plugin.manager.DefaultPluginManager] notifyPluginDisabled Disabling com.atlassian.gadgets.embedded
2010-01-04 16:00:09,285 ERROR [SpringOsgiExtenderThread-33] [extender.internal.activator.ContextLoaderListener] onOsgiApplicationEvent Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.atlassian.gadgets.opensocial, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gadgetRequestContextFactory_osgiService': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Can only register services while bundle is active or activating.
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
	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.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:136)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: Can only register services while bundle is active or activating.
	at org.apache.felix.framework.Felix.registerService(Felix.java:2681)
	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
	at org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean.registerService(OsgiServiceFactoryBean.java:310)
	at org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean.registerService(OsgiServiceFactoryBean.java:279)

And timeout errors such as the following:

2010-01-04 16:00:36,448 WARN [Timer-4] [internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] timeout Timeout occurred before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=com.atlassian.gadgets.directory, config=osgibundle:/META-INF/spring/*.xml)]
2010-01-04 16:00:36,449 ERROR [Timer-4] [internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] fail Unable to create application context for [com.atlassian.gadgets.directory], unsatisfied dependencies: Dependency on [(objectClass=com.atlassian.gadgets.directory.spi.DirectoryPermissionService)] (from bean [&permissionService]), Dependency on [(objectClass=com.atlassian.gadgets.directory.spi.ExternalGadgetSpecStore)] (from bean [&externalGadgetStore]), Dependency on [(objectClass=com.atlassian.gadgets.GadgetRequestContextFactory)] (from bean [&gadgetRequestContextFactory])
org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.gadgets.directory' has timed out
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)

Cause

There are two possible causes for this behavior, the first one is that OSGi (v2) plugins that ship by default with Confluence wait 60 seconds for Confluence to start up and load the necessary plugins that these plugins depend on.
If Confluence takes longer than 60 seconds to start up, these plugins will start timing out and fail to load giving errors such as the above.

The second cause is that Mcafee (or another virus scanner) could be blocking some of the add-ons to start and hence causing their dependencies to fail as well.

The third cause could be corrupted plugin cache after some issues during the upgrade.

Pre-workaround action

If you have the issue after the upgrade of Confluence, JVM or the database please clear the plugins cache before proceeding with other workarounds.

Workaround 1

If you are using any kind of anti-virus try to add an exception on <Confluence HOME>/<Confluence INSTALL> directories or disable the anti-virus on Confluence application server.

Below instructions apply to disable confluence directories on Mcafee.

  1. Open “VirusScan Console”.
  2. Double click “On-Access Scanner”.
  3. Select “All Processes” --> “Exclusions” tab.
  4. Click “Exclusions”, Click “Add”.
  5. Enter the <Confluence INSTALL> directory path in the “name\location” field.
  6. Check the box “Also exclude subfolders”.
  7. Repeat the process with <Confluence HOME> directory.
  8. Apply the changes.
  9. Restart Confluence.

Workaround 2

If you are not using any anti-virus then try below workaround which will increase the timeout value for the plugin to 300 seconds, enable the Shared Access Layer (SAL), add permanent generation memory, and delete the plugin caches.

  1. In the installation folder of your Confluence go to the bin folder and open the setenv.bat or setenv.sh file in a text editor.
  2. Add the JVM parameter -Datlassian.plugins.enable.wait=300. See Configuring System Properties for tips on how to set an environment variable.
  3. Assess whether the SAL plugin is disabled, and if necessary enable it:
    1. Run the following query against your database:

      select * from BANDANA where BANDANAKEY='plugin.manager.state.Map';
      
    2. Note the setting for SAL:

      <map> 
       <entry> 
          <string>com.atlassian.sal.confluence</string> 
          <boolean>false</boolean> 
        </entry> 
        <entry> 
          <string>confluence.extra.dynamictasklist2</string> 
          <boolean>false</boolean> 
        </entry>
      </map>
      

      In this example com.atlassian.sal.confluence has been set to false, which is bad.

    3. If present, remove the sal plugin entry from the map, and update the map in the database (this will enable it):

      update BANDANA set BANDANAVALUE='<map> 
        <entry> 
          <string>confluence.extra.dynamictasklist2</string> 
          <boolean>false</boolean> 
        </entry>
      </map>' where BANDANAKEY='plugin.manager.state.Map';
      
  4. If running Java 7 or below, increase your PermGen memory. See How to fix out of memory errors by increasing available memory.
  5. Delete the directories (see clear Confluence plugins cache )
    • <confluence-home>/bundled-plugins
    • <confluence-home>/plugins-cache
    • <confluence-home>/plugins-osgi-cache
    • <confluence-home>/plugins-temp
    • <confluence-home>/bundled-plugins_language
  6. Restart Confluence

Still having problems?

This problem is sometimes caused by performance issues. Try increasing your server specs or doing some performance tuning.

Please note that the attached atlassian-bundled-plugins.zip is only compatible with Confluence 3.1.x

If the recommendations did not fix your problem, there is another workaround you can follow.

Some of the plugins do not follow the JVM parameter timeout setting; They have their own, which is set to 60 seconds.

Please find attached an atlassian-bundled-plugins.zip file where these plugins timeout setting have been modified, replace your <confluence install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup/atlassian-bundled-plugins.zip with it and restart Confluence.

Note for newer version of Confluence

For newer versions of Confluence, there is no atlassian-bundled-plugins.zip but the contents of this file are under the directory /atlassian-bundled-plugins

Note

If you are facing this using Confluence under 3.2 then upgrade to Confluence 3.2 since the bug fix at PLUG-516 is included.
Last modified on Mar 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.