I have a Confluence setup with lots of data uploaded and its important to retain the server
Asked by sahanajsj:

Actually having a confluence setup which was working fine earlier with lot of data, and later stopped working with the issues.

When start Confluence, noticing the below error:

[@Confluence](/t5/user/viewprofilepage/user-id/338789):/opt/atlassian/confluence/bin$ sudo**./start-confluence.sh -**fg

What this error means and how to resolve the below error. It helps to troubleshoot. Any suggestion are welcome.

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

**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
```


Answers:
author: Sid
body: [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) ,

From the above replies I see all your configurations are fine.

step 1 - Do you have all you data backed up? If yes try to create a new database with and restore the data.

Try finishing this installation with empty database, once done try to point to the restored Db and restart the application. This should get all the previous data.

Let me know if that helps


author: Kiran Panduga {Appfire}
body: Hi [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) ,

There are many reasons one see this error message while starting the Confluence.

I would recommend to review the below Atlassian KB article which list out the reason for receiving the error

Spring Application context has not been set

<https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html>

if you are still noticing the issue, share the complete error message log for additional review.

Thanks,

Kiran.

comments: author: sahanajsj
body: Thank you both for your suggestions.

Actually, I tried changing the ownership permissions of my "confluence" user. When running the confluence start/stop commands, still requires sudo permission. Please help, what to do now - I'm new to confluence setup. (trying to troubleshoot the existing setup, Installation and configuration setup has done by another engineer earlier)

![confluence-permissions.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/46137i82138D4D631DB28A/image-size/large?v=v2&px=999 "confluence-permissions.PNG")

Start Confluence:

![confluence-commands.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/46139iF149F9C2E841FEC8/image-size/large?v=v2&px=999 "confluence-commands.PNG")

After starting Confluence, Im getting setupstart.action page as below:

![confluence-webbrowser.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/46141i7F660CF719CB515E/image-size/large?v=v2&px=999 "confluence-webbrowser.PNG")


author: sahanajsj
body: I used these commands to change the permissions:

**$ sudo chown -R confluence.confluence /var/atlassian/application-data/confluence**

**$ sudo chown -R confluence.confluence /opt/atlassian/confluence**

**$ sudo chmod -R u=rwx,go-rwx /var/atlassian/application-data/confluence**

**$ sudo chmod -R u=rwx,go-rwx /opt/atlassian/confluence**


author: Kiran Panduga {Appfire}
body: Hi [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) ,

setupstart.action page indicates that the Confluence has started, now you just need to complete the installation steps and configure your database schema

After which you should be able to login and access the Confluence instance.

Thanks,

Kiran.


author: sahanajsj
body: Thanks for the reply, but I wonder these installation steps configurethe confluence newly? or will i able to get the earlier configured setup which has my data and files.


author: sahanajsj
body: [@Kiran Panduga {Appfire}](/t5/user/viewprofilepage/user-id/645618) Im not clear at this point of installation, its like a new installation of confluence and configure to my existing/old Database?

How it works, can please brief me.


author: Kiran Panduga {Appfire}
body: [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) Can you check if the home directory is pointing to the correct path by validating the below configuration file ?

**/opt/atlassian/confluence/Confluence/WEB-INF/classes/confluence-init-properties**

Also, verify the confluence.cfg.xml file in the home directory **/var/atlassian/application-data/confluence**, it should have reference to your old database schema.

If this file is missing, it will create new confluence.cfg.xml file and due to which new installation is starting.

Thanks,

Kiran


author: sahanajsj
body: [@Kiran Panduga {Appfire}](/t5/user/viewprofilepage/user-id/645618)

I verified the configuration file, it seems pointing properly to home-directory

![confluence-properties.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/46177i454CCB32FA8AEBE7/image-size/large?v=v2&px=999 "confluence-properties.PNG")

In confluence.cfg.xml file, im not seeing any database schema related.

![confluence-database.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/46178i6661622CC8F4CD1C/image-size/large?v=v2&px=999 "confluence-database.PNG")

Now, what are the ways to look for existing database Schema or to configure again to retain the data without any loss.?

Please suggest.


author: Kiran Panduga {Appfire}
body: Hi [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) ,

I'm afraid, now there are only two options to retain the existing data.

* Do you have a copy of your old home directory ? If so, you can restore it.

(or)

* If you were using MySQL database schema, then try adding the below parameters into the confluence.cfg.xml file to point to your existing database and then restart the Confluence. It should bring up the old data.

{code}

\<property name="hibernate.connection.driver_class"\>com.mysql.jdbc.Driver\</property\>  
\<property name="hibernate.connection.password"\>confluencepass\</property\>  
\<property name="hibernate.connection.url"\>jdbc:mysql://\<servername\>/\<databasename\>?autoReconnect=true\</property\>  
\<property name="hibernate.connection.username"\>confluencedbuser\</property\>  
\<property name="hibernate.database.lower_non_ascii_supported"\>true\</property\>  
\<property name="hibernate.dialect"\>com.atlassian.hibernate.dialect.MySQLDialect\</property\>

{code}

For more information, refer to the below KB article

<https://confluence.atlassian.com/confkb/how-to-find-confluence-s-database-connection-parameters-779172320.html>

Thanks,

Kiran.


author: Sid
body: Hi [@sahanajsj](/t5/user/viewprofilepage/user-id/2720351) ,

This error is likely to be a permission issue. Make sure you apply the correct permissions to the sub-folders as well of your *home-directory* and *install-folder* . (read and write permissions are to be given).

If that doesn't solve the issue, post the logs

comments: author: Sid
body: this KB might help you - <https://confluence.atlassian.com/confkb/confluence-does-not-start-due-to-spring-application-context-has-not-been-set-218278311.html>


Tags: confluence-server

server