Confluence can't start
Asked by runfeng cao:

Hi :

I installed confluence and jira in linux centos,there is ok . but after the server power off,

confluence can't start ,error message show bellow, JIRA is ok. thanks for help.

i was try unintall and reinstall confluence , problem still there

HTTP Status 500 - java.lang.IllegalStateException: Spring Application context has not been set {#toc-hId-1848638787}
====================================================================================================================

**type** Exception report

**message** ++java.lang.IllegalStateException: Spring Application context has not been set++

**description** ++The server encountered an internal error that prevented it from fulfilling this request.++

**exception**

```
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set	com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)	com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)	com.atlassian.confluence.plugin.servlet.filter.ServletFilterModuleContainerFilter.getServletModuleManager(ServletFilterModuleContainerFilter.java:20)	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:62)	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58)	com.atlassian.confluence.internal.web.filter.spring.IgnoreWebAsyncManagerFilter.doFilter(IgnoreWebAsyncManagerFilter.java:59)	com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter.doFilter(RequestParamValidationFilter.java:51)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.web.filter.TranslationModeFilter.doFilter(TranslationModeFilter.java:39)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.plugin.servlet.filter.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:72)	com.atlassian.confluence.web.filter.LanguageExtractionFilter.doFilter(LanguageExtractionFilter.java:45)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.impl.vcache.VCacheRequestContextFilter.doFilter(VCacheRequestContextFilter.java:58)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:65)	com.atlassian.confluence.web.filter.ZipkinTracingFilter.doFilter(ZipkinTracingFilter.java:54)	com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:23)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.web.ConfluenceJohnsonFilter.doFilter(ConfluenceJohnsonFilter.java:31)	com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:41)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.impl.servlet.HoldingUntilStartedFilter.doFilter(HoldingUntilStartedFilter.java:88)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)	com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:64)	com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
```

**root cause**

```
java.lang.IllegalStateException: Spring Application context has not been set	com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)	com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)	com.atlassian.confluence.util.LazyComponentReference$Accessor.get(LazyComponentReference.java:42)	com.atlassian.util.concurrent.Lazy$Strong.create(Lazy.java:85)	com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)	com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)	com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)	com.atlassian.confluence.plugin.servlet.filter.ServletFilterModuleContainerFilter.getServletModuleManager(ServletFilterModuleContainerFilter.java:20)	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:62)	com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58)	com.atlassian.confluence.internal.web.filter.spring.IgnoreWebAsyncManagerFilter.doFilter(IgnoreWebAsyncManagerFilter.java:59)	com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter.doFilter(RequestParamValidationFilter.java:51)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.web.filter.TranslationModeFilter.doFilter(TranslationModeFilter.java:39)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.plugin.servlet.filter.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:72)	com.atlassian.confluence.web.filter.LanguageExtractionFilter.doFilter(LanguageExtractionFilter.java:45)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.impl.vcache.VCacheRequestContextFilter.doFilter(VCacheRequestContextFilter.java:58)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:65)	com.atlassian.confluence.web.filter.ZipkinTracingFilter.doFilter(ZipkinTracingFilter.java:54)	com.atlassian.confluence.web.filter.ResponseOutputStreamFilter.doFilter(ResponseOutputStreamFilter.java:23)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.confluence.web.ConfluenceJohnsonFilter.doFilter(ConfluenceJohnsonFilter.java:31)	com.atlassian.confluence.impl.servlet.HoldingUntilStartedFilter.doFilter(HoldingUntilStartedFilter.java:88)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)	com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)	com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:64)	com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)	com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
```

**note** ++The full stack trace of the root cause is available in the Apache Tomcat/8.0.36 logs.++  


Answers:
author: Steven F Behnke
body: There is a KB article for this --

<https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html>
>
> Cause {#toc-hId-1652125283}
> ---------------------------
>
> 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.

comments: author: runfeng cao
body: Thanks Steven,

I have try the following things,but problem still there ![sad](/html/@C495B4504065515364EB1894F812B34C/images/emoticons/sad.png "sad")

1. chown -R confluence.confluence \<confluence-install-folder\>

chown -R confluence.confluence \<confluence-home-folder\>  
chmod -R u=rwX,go-rwx \<confluence-install-folder\>  
chmod -R u=rwX,go-rwx \<confluence-home-folder\>

2. start with confluence user , check firewall is ok (JIRA start was ok)

3. mysql driver in \<install\>/confluence/lib and \<install\>/confluence/WEB- INF/lib folder

4. i use Ipaddress:8090 to access in the web. /etc/hosts also have configuration item:

172.24.50.197 jira  
172.24.50.197 confluence