user2507194
user2507194

Reputation: 185

Confluence configuration Spring Application context has not been set

I tried to install confluence on my own ubuntu server, but always failed. The error is:

com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)

caused by: java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)

I saw some solutions in the jira confluence forum saying try to fix the permission of installed directory and home directory. I tried but failed again. How can I fix the problem.

Upvotes: 6

Views: 8737

Answers (2)

Pavel Kovalev
Pavel Kovalev

Reputation: 8156

In my case the issue was corrupted confluence.cfg.xml file (contains DB connection stings and other settings). The file size was 0 bytes.

I would suggest to use a VM to create a new installation and borrow confluence.cfg.xml from that installation.

It's embarrassing that this behavior has been allowed to exist for nearly 7 years in a commercial product. This is a basic stuff...

I wish that was on instructions somewhere: Make single backup copy of confluence.cfg.xml immediately before any writes to it by the application. Application should be able to restore from backed up copy if it gets corrupted.

Upvotes: 3

grzegorz.kosciolek
grzegorz.kosciolek

Reputation: 141

Atlassian documentation lists the following causes of this problem:

  1. 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.
  2. You are running Confluence as the root user or if you have an application firewall enabled (SeLinux or AppArmor).
  3. 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.
  4. The hostname of the server can not be resolved.

In my case I was running it as root user inside docker container.

Upvotes: 1

Related Questions