Confluence Data Center does not start due to Spring Framework error
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Confluence Data Center fails to start. The logs show an error related to the Spring framework. There can be many different causes for this.
Error log details
On Confluence Startup, the following error is thrown:
2010-06-18 21:54:45,432 INFO [main] [com.atlassian.confluence.lifecycle] init Confluence is ready to serve
2010-06-18 21:55:20,515 FATAL [http-8080-1] [atlassian.spring.container.SpringContainerContext] getComponent Spring Application context has not been set
2010-06-18 21:55:20,528 ERROR [http-8080-1] [[Standalone].[localhost].[/].[action]] log Servlet.service() for servlet action threw exception
java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)
at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:32)
at com.atlassian.confluence.security.seraph.ConfluenceElevatedSecurityGuard.getCaptchaManager(ConfluenceElevatedSecurityGuard.java:115)
This error may also be thrown:
15-Nov-2015 23:57:33.447 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Tomcat-Standalone
15-Nov-2015 23:57:33.447 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.28
2015-11-15 23:57:45,736 INFO [localhost-startStop-1] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 5.8.16 [build 5996 based on commit hash 4a6343ec7ed8542179d6c78fa7f87c01f81da016]
15-Nov-2015 23:58:06.434 SEVERE [Standalone-startStop-1] org.apache.catalina.startup.HostConfig.start Unable to create directory for deployment: /opt/atlassian/confluence/conf/Standalone/localhost
This error may also be thrown:
java.util.concurrent.CompletionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedTransactionManager' defined in class path resource [databaseSubsystemContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedLocalSessionFactoryBean5' defined in class path resource [productionDatabaseContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: premature SessionFactory initialisation, Hibernate properties have not yet been persisted in confluence.cfg.xml
Or this one, during installation after a restart:
2016-11-30 12:23:12,241 ERROR [http-nio-8090-exec-3] [confluence.util.profiling.ConfluenceSitemeshErrorDecorator] renderInternal Failed to render error decorator. Falling back to using no decorator
-- traceId: 006cacff18fcfffe
javax.servlet.ServletException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getLocale' in class com.atlassian.confluence.core.ConfluenceActionSupport threw exception java.lang.IllegalStateException: Spring Application context has not been set at /decorators/includes/header.vm[line 58, column 41]
File and database permissions
The user running Confluence does not have write permissions to the home folder defined in <install>/confluence/WEB-INF/classes/confluence-init.properties
or the install directory.
Linux
Do not run Confluence as root, and ensure that the user running Confluence has full read and write access to the home folder. This can be set by running chmod -R
with the appropriate permissions, to apply them recursively to each subfolder. An example of the right permissions would be:
sudo chown -R <confluence-user> <confluence-install-folder>
sudo chown -R <confluence-user> <confluence-home-folder>
sudo chmod -R u=rwx,g=rx,o=rx <confluence-install-folder>
sudo chmod -R u=rwx,g=rx,o=rx <confluence-home-folder>
The user confluence is only a suggestion. You can change it for another username.
Windows
- Right-click the <Confluence Home> Folder
- Select Properties
- Select Security
- Add the user that is being used to run Confluence with full read and write access
The Confluence database permissions are incorrect.
We recommend that the database user is the owner of the Confluence database. When using PostgreSQL, the user has to be the owner of the Confluence database. Oracle, MySQL, and MSSQL need only the necessary permissions.
Confluence configuration errors
The database driver is not located in the <install>/confluence/WEB-INF/lib
folder or you are using a database version that is incompatible with the bundled driver.
Check the Supported Platforms and Database JDBC Drivers pages and verify that the required driver is located under <install>/confluence/WEB-INF/lib and your database version is compatible with the Confluence version.
The server does not have enough memory during installation to set up the database, and restarts return this error.
Confirm your server has enough physical memory to run the JVM. Confluence 6.0 requires 2GB. Before re-starting the installer, restart the Setup Wizard by following the steps outlined in Resolution 10.
The file <confluence-home>/confluence.cfg.xml is corrupt.
The <confluence-home>/confluence.cfg.xml
file needs to be properly formatted. It can be checked using online tools like W3 School XML Validator or advanced editors like IntelliJ or Eclipse. The file might have some hidden characters like "space" in the wrong place (e.g before the opening <?xml....> or some elements might not be closed properly which can break the XML file format.
Please note that confluence.cfg.xml
can hold sensitive information (e.g. passwords) and because of that, we advise you to remove them (sensitive information) prior to testing it with online tools.
If you're using a MySQL database, either the collation or character set properties are not set correctly.
Please check the collation and character set of the database and verify:
<charset>
is set to eitherutf8
orutf8mb4
<collation>
is set to eitherutf8_bin
orutf8mb4_bin
- See How to Fix the Collation and Character Set of a MySQL Database manually for more information
Network connectivity
You have an application firewall enabled (SeLinux or AppArmor).
If SeLinux or AppArmor are running, try temporarily disabling them to see if they are causing issues.
The hostname of the server can't be resolved.
The hostname you are using must be resolvable (try ping $HOSTNAME
). E.g. The hostname localhost
has not been added to /etc/hosts
. See java.net.UnknownHostException exceptions in Confluence log file due to DNS lookups failing.
The network interface bound on the affected node is incorrect.
The wrong network interface might be specified. For example, an interface named eth2 in one node could be the same interface that is named eth3 in another. In this case, we'll need to find out which interface is the correct one. Follow the resolution steps outlined in this KB article to find out, then change the confluence.cfg.xml file to use the proper network interface: https://confluence.atlassian.com/confkb/hazelcast-cannot-start-on-this-node-no-matching-network-interface-found-646447553.html
Confluence is actively being monitored by a health check from a load balancer, other users are accessing Confluence, or other browser tabs are refreshing the confluence base URL.
We recommended that only one Browser window be connected to Confluence when the initial installation wizard is running, and that no other user or health check is targeting the Confluence instance. Multiple open browser windows will be polling the Server for a status update, which may affect the Setup and result in a Spring Context error as per CONFSERVER-59084 - Improve installation process by preventing any other request to brake installation.
Upgrade was interrupted
The Setup Wizard must perform certain tasks. For whatever reason, the Confluence instance has been stopped or the server has been restarted before finishing all the upgrade steps.
Each step can be identified by checking the URL in the web browser. A typical Confluence installation would go through the following URLs (they may vary depending on the options you choose):
<base-url>/setup/setupstart.action
- <base-url>/setup/selectbundle.action
- <base-url>/setup/setuplicense.action
- <base-url>/setup/setupcluster.action
- <base-url>/setup/setupcluster-start.action - DC
- <base-url>/setup/setupdbchoice-start.action - DC
- <base-url>/setup/setupdata-start.action - DC
- <base-url>/setup/finishsetup.action - DC
- <base-url>/setup/setupdbtype-start.action
- <base-url>/setup/setupdata-start.action
- <base-url>/setup/setupusermanagementchoice-start.action
- <base-url>/setup/complete.action
If this is a fresh installation, you can use the steps below to restart the installation.
This will completely wipe the original instance and data in the database.
Stop Confluence
Backup and delete the <confluence-home>/confluence.cfg.xml file
Start Confluence
Access the Base URL in your browser to start the Setup Wizard from the beginning
During the database configuration step, choose "Continue and overwrite existing data" if prompted
- Make sure all the steps are completed successfully.