Confluence suddenly stopped working
Asked by Roget Luo:

Confluence hosted on Windows 2012 VM, stopped working recently, getting Apache Tomcat/7.047 Error report, "HTTP Status 500-java.lang.NullPointerException" when trying to pull up the dashboard URL.

On the hosting VM, Apache Tomcat 6.0 shows in Services.msc and it's running. Atlassian Conflence is up and running as well. Browsed to the Confluence\\bin folder, tried to run tomcat7w, got "The specified service does not exists as an install service. Unable to open service tomcat7".

No experience in Apache or Confluence, any help is greatly appreciated.


Answers:
author: AnnWorley
body: Hi Roget,

Please try:

1. Shut down the Confluence service in services.msc. There should not be a second service for Tomcat for Confluence so unless the Tomcat service is a known application please shut it down, too.
2. Start Confluence by running the start-confluence.bat file in the \<confluence_install\>/bin folder at an elevated command prompt (This will open a command window with startup messages, if you close it, Confluence will shut down)
3. Try accessing Confluence in the browser
4. If all is well in the browser, use \<confluence_install\>/bin/stop-confluence.bat to shut Confluence down
5. Start the Confluence service and see if the error appears in the browswer
6. If the error appears with the service and not the manual start-up then reinstall the service as described in [Start Confluence Automatically on Windows as a Service](https://confluence.atlassian.com/doc/start-confluence-automatically-on-windows-as-a-service-172071.html) - the instructions for removing the old service first are at the bottom of the page.

Since you are using Tomcat 7, I assume you are using an older version of Confluence as Confluence uses Tomcat 8 now.

If you still see an error after starting Confluence manually with the .bat file please let us know the error, what version of Confluence you are running and any relevant looking entries in:  
\<confluence_install\>/logs/ (anything recent in this directory) and \<confluence_home\>/logs/atlassian-confluence.log.  
(note) The \<confluence_home\> directory is the path defined in the following file: \<confluence_install\>/confluence/WEB-INF/classes/confluence-init.properties

Thanks,

Ann

comments: author: Roget Luo
body: Hi Ann,

Thank you for the reply. Followed steps 1 \& 2 but still pulling up the java.lang.NullPointerException when trying to pull up the web page, with the following

**message** ++java.lang.NullPointerException++

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

**exception**

```
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149) com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112) com.atlassian.confluence.setup.ConfluenceEncodingFilter.getGlobalSettings(ConfluenceEncodingFilter.java:47) com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncodingInternal(ConfluenceEncodingFilter.java:37) com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncoding(ConfluenceEncodingFilter.java:29) com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:38) 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:65) com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:50) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
```

**root cause**

```
java.lang.NullPointerException com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33) com.atlassian.confluence.util.LazyComponentReference$Accessor.get(LazyComponentReference.java:46) 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.setup.ConfluenceEncodingFilter.getGlobalSettings(ConfluenceEncodingFilter.java:47) com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncodingInternal(ConfluenceEncodingFilter.java:37) com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncoding(ConfluenceEncodingFilter.java:29) com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:38) 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:65) com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:50) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
```


author: Roget Luo
body: Confluence version: 5.5 \[build 5501\]

Java version: 8 Update 171


author: AnnWorley
body: Hi Roget,

The supported Java version for Confluence 5.5 is Java 1.7 ([Supported Platforms](https://confluence.atlassian.com/display/CONF55/Supported+Platforms)). I have not been successful running older Confluence instances against newer Java versions so let's get started by installing a supported version of Java:

* [Installing Java for Confluence](https://confluence.atlassian.com/display/CONF55/Installing+Java+for+Confluence)
* [Setting the JAVA_HOME Variable in Windows](https://confluence.atlassian.com/display/CONF55/Setting+the+JAVA_HOME+Variable+in+Windows)

If Confluence still won't start up after installing a supported version of Java, please check for more clues in the logs at:  
\* \<confluence_install\>/logs/ (anything recent in this directory)  
\* \<confluence_home\>/logs/atlassian-confluence.log  
(note) The \<confluence_home\> directory is the path defined in the following file: \<confluence_install\>/confluence/WEB-INF/classes/confluence-init.properties

I should mention that Confluence 5.5 has passed End of Life status: [Atlassian Support End of Life Policy](https://confluence.atlassian.com/support/atlassian-support-end-of-life-policy-201851003.html). Please follow our guide,[Upgrading Confluence](https://confluence.atlassian.com/doc/upgrading-confluence-4578.html) when you have a chance.

Thanks,

Ann


author: Roget Luo
body: Hi Ann,

Uninstalled the latest JAVA and installed JAVA 1.7.0_80-b15, set the JAVA_HOME variable but still same HTTP 500-java.lang.NullPointerException.

The atlassian-confluence log file is quite lengthy, is there a way to upload it? Here are several noteworthy lines:

org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

Caused by: java.net.ConnectException: Connection refused: connect

java.sql.SQLException: Connections could not be acquired from the underlying database!

com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.


author: AnnWorley
body: If we need to do file sharing to examine logs I can open a support ticket but it may not be necessary as the errors you posted are startup showstoppers. Confluence cannot connect to it's database. This article reports that a configuration parameter in PostgreSQL can be changed to remedy the issue: [Confluence PostgreSQL JDBC direct connection refused](https://confluence.atlassian.com/confkb/confluence-postgresql-jdbc-direct-connection-refused-683543784.html)


author: Roget Luo
body: Hi Ann,

Thanks for your continue help in this matter. Looks like PostgreSQL install got corrupted on this server. It was on version 9.3, should I reinstall the same version, and anything I should look out for during the install?

Also, would it be easier if we just upgrade Confluence to a newer version?


author: AnnWorley
body: The same version of PostgreSQL is a good idea because if you want your data from the old instance you will need to export it from the old database and import it on the new PostgreSQL - I found an article on how to do it but it's not an Atlassian article: [How to import and export a PostgreSQL database](https://www.a2hosting.com/kb/developer-corner/postgresql/import-and-export-a-postgresql-database)

Before importing data to the new database, please make sure it is set up as described in [Database Setup for PostgreSQL](https://confluence.atlassian.com/doc/database-setup-for-postgresql-173244522.html)

Since you mentioned you are running Confluence on Windows, I thought this may help for the PostgreSQL install: [WINDOWS INSTALLERS](https://www.postgresql.org/download/windows/)

Please make sure your existing instance is stable before upgrading. We have made a lot of improvements in the last few years so I do recommend upgrading. Please go over [Upgrading Confluence](https://confluence.atlassian.com/doc/upgrading-confluence-4578.html) during the planning stages of the upgrade as it has a good "before you start" section.


author: Roget Luo
body: Sounds like its best to reinstall PostgreSQL 9.3 first and make sure everything is working then perform the Confluence upgrade?


author: AnnWorley
body: Yes, that would be the most methodical way to proceed. That way we won't be left guessing whether any future issues are related to the upgrade or the database incident. :)


author: Roget Luo
body: Thanks!! Looks like a "fun" weekend project ahead for me. :-)I will update you soon. Really appreciated all your help.

Quick note, I'm looking into renewing annual maintenance, is it really $10 / year? We have less than 10 users who will access Confluence.


author: AnnWorley
body: Yes, it's just $10/year for 1-10 users: [How much is it to renew my Confluence software maintenance?](https://www.atlassian.com/licensing/confluence#serverlicenses-2)

Shameless plug: [Atlassian donates 100% of Starter License payments to charity, absorbing all transactions costs incurred in payment processing.](https://www.atlassian.com/licensing/starter#licensingandordering-1)

I am truly happy I was able to help, I hope you will keep us posted on how it goes.


author: Roget Luo
body: Hi Ann,

I located the 5.5-1 .exe file, would it fix the issue if I simply reinstall Confluence on the server?


Tags: confluence-server

server