Confluence unable to be used after upgrading Java to 1.7
Symptoms
Confluence 4.3 supports both Java 1.6 and 1.7, however, if the JRE/JDK is changed from 1.6 to 1.7, then Confluence is restarted it is unable to be used, stating that bundled plugins that are required are unable to start.
The following appears in the atlassian-confluence.log
:
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle confluence.extra.masterdetail [102]: Unable to resolve 102.0: missing requirement [102.0] package; (&(package=javax.naming)(version>=0.0.0.1_006_JavaSE)(version<=0.0.0.1_006_JavaSE))
2013-09-05 08:55:25,461 ERROR [main] [plugin.osgi.factory.OsgiPlugin] enableInternal Detected an error (BundleException) enabling the plugin 'com.atlassian.activeobjects.activeobjects-plugin' : Unresolved constraint in bundle com.atlassian.activeobjects.activeobjects-plugin [26]: Unable to resolve 26.0: missing requirement [26.0] package; (&(package=com.atlassian.activeobjects.spi)(version>=0.17.0)) [caused by: Unable to resolve 27.0: missing requirement [27.0] package; (&(package=javax.sql)(version>=0.0.0.1_006_JavaSE)(version<=0.0.0.1_006_JavaSE))]. This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see http://confluence.atlassian.com/x/1xy6D
2013-09-05 08:55:25,463 WARN [main] [plugin.osgi.factory.OsgiPlugin] enable Unable to enable plugin 'com.atlassian.activeobjects.activeobjects-plugin'
com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.atlassian.activeobjects.activeobjects-plugin
at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:445)
at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:237)
Diagnosis
Confluence was originally using Java 1.6 and has been changed to use Java 1.7. This is typically done by modifying the $JAVA_HOME and restarting Confluence.
Cause
Confluence was set up using Java 1.6, hence all the expanded plugins (the caches) stores data compatible with Java 1.6. However, when the $JAVA_HOME was changed to use Java 1.7 and the plugin framework attempts to enable those expanded plugins, it finds them to be incompatible with Java 1.7 and they do not enable.
Resolution
- Shutdown Confluence
- Ensure the user running Confluence has full read/write privileges to the confluence-home directory.
- Remove the following directories
This will remove the plugin cache files only and will not permanently remove any plugins. These directories will be recreated during the next Confluence startup. However, some third-party plugins may store metadata in these directories, so we recommend creating a temporary backup of the directories.<confluence-home>/bundled-plugins
<confluence-home>/plugins-cache
<confluence-home>/plugins-osgi-cache
<confluence-home>/plugins-temp
<confluence-home>/bundled-plugins_language
- Start Confluence