Application context initialization for 'com.atlassian.oauth.serviceprovider' plugin has timed out
Asked by Shravan P:

I upgraded Confluence from 5.1 to 5.4.2 and I see the following exception:

```
2014-02-12 01:39:41,565 ERROR [Timer-6] [internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] fail Unable to create application context for [com.atlassian.oauth.atlassian-oauth-service-provider-plugin], unsatisfied dependencies: Dependency on [(objectClass=com.atlassian.sal.api.auth.OAuthRequestVerifierFactory)] (from bean [&amp;oAuthRequestVerifierFactory])org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.oauth.atlassian-oauth-service-provider-plugin' has timed out        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)2014-02-12 01:39:41,566 ERROR [Timer-6] [plugin.osgi.factory.OsgiPlugin] logAndClearOustandingDependencies Never resolved service '&amp;oAuthRequestVerifierFactory' for plugin 'com.atlassian.oauth.serviceprovider' with filter (objectClass=com.atlassian.sal.api.auth.OAuthRequestVerifierFactory)2014-02-12 01:39:41,567 ERROR [Timer-6] [plugin.osgi.factory.OsgiPlugin] onPluginContainerFailed Unable to start the plugin container for plugin com.atlassian.oauth.serviceproviderorg.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.oauth.atlassian-oauth-service-provider-plugin' has timed out        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)2014-02-12 01:39:41,567 ERROR [Timer-6] [extender.internal.activator.ContextLoaderListener] onOsgiApplicationEvent Application context refresh failed (NonValidatingOsgiBundleXmlApplicationContext(bundle=com.atlassian.oauth.atlassian-oauth-service-provider-plugin, config=osgibundle:/META-INF/spring/*.xml))org.springframework.context.ApplicationContextException: Application context initialization for 'com.atlassian.oauth.atlassian-oauth-service-provider-plugin' has timed out        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:454)
```

I didnt have this issue in 5.1  
I tried following this guide: [](https://confluence.atlassian.com/display/CONFKB/Plugins+are+Disabled+at+Startup+and+Various+Timeout+Errors+Appear+in+the+Logs+After+Startup)<https://confluence.atlassian.com/display/CONFKB/Plugins+are+Disabled+at+Startup+and+Various+Timeout+Errors+Appear+in+the+Logs+After+Startup>  
1. **increase the timeout value for the plugin to 300 seconds**  
Comments: adding timeout of 300 sec didnt work  
2. **enable the Shared Access Layer**  
Comments: the query `select` `* ``from` `BANDANA ``where` `BANDANAKEY=``'plugin.manager.state.Map'`  
returns:  
"\<map\>  
\<entry\>  
\<string\>com.atlassian.confluence.whatsnew:show-whats-new-flag\</string\>  
\<boolean\>true\</boolean\>  
\</entry\>  
\</map\>"  
3. **permanent generation memory**  
Comments: It is set to 1024m  
4. **delete the plugin caches**  
Comments: done  
I still see the same exception in the log file. And yes, I have restarted confluence after doing these changes. I also see that the system add on "Atlassian OAuth Service Provider Plugin" has been disabled with no option/button to enable it.  


Answers:
author: hsuhailah
body: This turns out to be a bug which has been reported here: [](https://jira.atlassian.com/browse/CONF-32397.)<https://jira.atlassian.com/browse/CONF-32397>. The fix is incorporated in v5.4.3 release.

comments: author: Shravan P
body: I dont see links to download 5.4.3. When is it going to be released? Does this issue exist in 5.4.1? We are on 5.1 and we have plans to upgrade our poduction instance to the latest version. If the issue doesnt exist in 5.4.1, we will upgrade to it. Please let me know.


author: hsuhailah
body: I can confirm that the issue does not happen in 5.4.1 - just in 5.4.2 so you may proceed with the upgrade to 5.4.1


Tags: confluence-administration