# Dhis.war deployment issue

**URL:** <https://community.dhis2.org/t/dhis-war-deployment-issue/36534>\
**Category:** Support - Assistance technique\
**Created:** [14 July 2019 14:45 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534 "2019-07-14T14:45:42Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [14 July 2019 14:45 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/1 "2019-07-14T14:45:42Z")

</div>

```
* ERROR 2019-07-14 20:09:56,240 Context initialization failed (ContextLoader.java [RMI TCP Connection(2)-127.0.0.1])
java.lang.IllegalStateException: Properties could not be loaded
	at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:341)
	at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.init(DefaultDhisConfigurationProvider.java:110)
	at org.hisp.dhis.condition.PropertiesAwareConfigurationCondition.getConfiguration(PropertiesAwareConfigurationCondition.java:57)
	at org.hisp.dhis.condition.RedisEnabledCondition.matches(RedisEnabledCondition.java:49)
	at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:447)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:128)
	at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:457)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:406)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.hisp.dhis.external.location.LocationManagerException: External directory not set
	at org.hisp.dhis.external.location.DefaultLocationManager.buildDirectory(DefaultLocationManager.java:233)
	at org.hisp.dhis.external.location.DefaultLocationManager.getFileForReading(DefaultLocationManager.java:163)
	at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:136)
	at org.hisp.dhis.external.location.DefaultLocationManager.getInputStream(DefaultLocationManager.java:129)
	at org.hisp.dhis.external.conf.DefaultDhisConfigurationProvider.loadDhisConf(DefaultDhisConfigurationProvider.java:330)
	... 65 more

```

---

<div class="post-metadata">

**Author:** ![jomutsani](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/jomutsani/32/44505_2.png) [@jomutsani](https://community.dhis2.org/u/jomutsani)\
**Post date:** [15 July 2019 13:06 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/2 "2019-07-15T13:06:29Z")

</div>

Hi @girishm,

You might need to install your DHIS2 instance properly; (which version are you installing?)

Set the DHIS2\_HOME environment variable as stipulated on the setup instructions and links you can find on this thread; [Installing DHIS2 on a Windows Local Server](https://community.dhis2.org/t/installing-dhis2-on-a-windows-local-server/34851). Also

Let us know if this persists.

Best,  
James.

---

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [15 July 2019 23:25 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/3 "2019-07-15T23:25:56Z")

</div>

Hi @jomutsani,

I have been following the contribution guidelines as mentioned [here](https://github.com/dhis2/dhis2-core/blob/master/CONTRIBUTING.md).

I have cloned the repo and was able to build the project successfully using Maven. The deployment of dhis2.war in Tomcat is not working and the above exception is thrown. Also, localhost:8080/dhis gives a 404 Not Found error. I have followed all the steps as mentioned in the document for local-setup.

Current setup:  
OS: Fedora OS v30  
Java: OpenJDK 1.8  
Tomcat: 9.0.22

---

<div class="post-metadata">

**Author:** ![Hynek\_Kruzik](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/h/bc8723/32.png) [@Hynek\_Kruzik](https://community.dhis2.org/u/Hynek_Kruzik)\
**Post date:** [16 July 2019 09:22 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/4 "2019-07-16T09:22:56Z")

</div>

Hi @girishm. Most probably, there is problem either with DHIS2\_HOME variable or with Postgresql user name and password in the dhis.conf and/or hibernate.properties file. Ensure that DHIS2\_HOME variable is properly set in your environment and that user name and password in both configuration files match user name and password of your postgres database. Czech if you can connect the database usign this configuration - additionally have a look into your pg\_hba.conf file if the authentication i properly set.

---

<div class="post-metadata">

**Author:** ![dhec](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/dhec/32/28112_2.png) [@dhec](https://community.dhis2.org/u/dhec)\
**Post date:** [16 July 2019 20:58 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/5 "2019-07-16T20:58:31Z")

</div>

Hi @girishm, Since you have used this guide to build your war file, have you tried using [this](https://docs.dhis2.org/master/en/implementer/html/install_server_setup.html#) afterwards?

Instead of having to download war file from the site as wget, you use the compiled dhis.war file which you have to rename as ROOT.war as go on to your installation.

---

<div class="post-metadata">

**Author:** ![jomutsani](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/jomutsani/32/44505_2.png) [@jomutsani](https://community.dhis2.org/u/jomutsani)\
**Post date:** [16 July 2019 21:21 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/6 "2019-07-16T21:21:10Z")

</div>

this is insightful; thank you @dhec and @Hynek_Kruzik for your contribution. @girishm - kindly confirm if the suggestions above have been of assistance to you.

Best,  
James.

---

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [21 July 2019 02:55 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/7 "2019-07-21T02:55:39Z")

</div>

@Hynek_Kruzik, thanks for replying. I was using default H2 database as mentioned in the contribution guidelines. Should I stick to postgres database for it to work?

---

<div class="post-metadata">

**Author:** ![Hynek\_Kruzik](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/h/bc8723/32.png) [@Hynek\_Kruzik](https://community.dhis2.org/u/Hynek_Kruzik)\
**Post date:** [25 July 2019 07:35 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/8 "2019-07-25T07:35:22Z")

</div>

Dear girishm,  
H2 database should work in principal with DHIS2. However, I have never used it in the production environment thus cannot share any experince. At the other hand postgres database engine has been used in many DHIS2 implementation and it is open source as well. Community members could give you better support in this case.  
But you are free to experiment 🙂

Hynek

---

<div class="post-metadata">

**Author:** ![Ameen](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ameen/32/28293_2.png) [@Ameen](https://community.dhis2.org/u/Ameen)\
**Post date:** [25 July 2019 09:24 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/9 "2019-07-25T09:24:49Z")

</div>

@Hynek_Kruzik @girishm Please note that only Postgres is the supported database since DHIS V2.29. The entire functionality of dhis2 may not be supported if using any other database.

---

<div class="post-metadata">

**Author:** ![MohsinAnsari](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/mohsinansari/32/28361_2.png) [@MohsinAnsari](https://community.dhis2.org/u/MohsinAnsari)\
**Post date:** [1 August 2019 07:33 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/10 "2019-08-01T07:33:13Z")

</div>

Hi All,  
Please follow the below instructions to install dhis2 properly on Linux based systems.

## Install Java 8

sudo apt-get install openjdk-8-jdk

## Install PostgreSQL

sudo apt-get install postgresql-10 postgresql-contrib-10 postgresql-10-postgis-2.4  
sudo -u postgres createuser -SDRP dhis

## Create database & PostGIS extension in PostgreSQL

sudo -u postgres createdb -O dhis dhis2  
sudo -u postgres psql -c “create extension postgis;” dhis2  
Open /etc/postgresql/10/main/postgresql.conf file and set “max\_locks\_per\_transaction = 1024”  
Restart PostgresSQL by command : sudo service postgresql restart

## Creating DHIS2 configuration file

sudo -u dhis nano /home/dhis/config/dhis.conf

## Copy the below lines in dhis.config

connection.dialect = org.hibernate.dialect.PostgreSQLDialect  
connection.driver\_class = org.postgresql.Driver  
connection.url = jdbc:postgresql:dhis2  
connection.username = dhis  
connection.password = dhis  
connection.schema = update  
encryption.password = abcd

## Install Tomcat & setup for dhis2

sudo apt-get install tomcat8-user  
sudo nano /opt/apache-tomcat-8.5.41/bin/setenv.sh

Copy the lines to setenv.sh:

export JAVA\_HOME=‘/usr/lib/jvm/java-8-openjdk-amd64/’  
export JAVA\_OPTS=‘-Xmx2048m -Xms1024m’ //Change accordingly  
export DHIS2\_HOME=‘/home/dhis/config’

Copy the dhis.war inside /opt/apache-tomcat-8.5.41/webapps  
(You can download it from [Downloads - DHIS2](https://www.dhis2.org/downloads))

## Start Tomcat

cd /opt/apache-tomcat-8.5.41/bin  
./startup.sh

## Access dhis2 web application

http://IP\_OF\_YOUR\_SERVER:8080/dhis

---

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [6 August 2019 12:43 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/11 "2019-08-06T12:43:53Z")

</div>

I’m unable to find a match for `postgresql-contrib-10` and `postgresql-10-postgis-2.4` in the dnf or yum repositories for Fedora 30. Can you please share the repository sources for these installations on Fedora Linux?

---

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [6 August 2019 12:49 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/12 "2019-08-06T12:49:52Z")

</div>

Thanks for the installation guidelines @MohsinAnsari. I presume it works well for Debian based systems such as Ubuntu. However, it may need few tweaks to make it work for all Linux based systems especially Red Hat based distributions such as Fedora, CentOS etc.

---

<div class="post-metadata">

**Author:** ![MohsinAnsari](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/mohsinansari/32/28361_2.png) [@MohsinAnsari](https://community.dhis2.org/u/MohsinAnsari)\
**Post date:** [7 August 2019 13:48 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/14 "2019-08-07T13:48:33Z")

</div>

Setup Yum Repository & Install PostgreSQL on Fedora

rpm -Uvh [https://yum.postgresql.org/11/fedora/fedora-30-x86\_64/pgdg-fedora-repo-latest.noarch.rpm](https://yum.postgresql.org/11/fedora/fedora-30-x86_64/pgdg-fedora-repo-latest.noarch.rpm)  
sudo dnf install postgresql11-server  
/usr/pgsql-11/bin/postgresql-11-setup initdb

Start PostgreSQL Server & verify installation

sudo systemctl enable postgresql-11.service  
sudo systemctl start postgresql-11.service  
su - postgres -c “psql”

## Setup and configuration of pgAdmin 4 on Fedora

sudo dnf -y install [https://download.postgresql.org/pub/repos/yum/reporpms/F-30/pgdg-fedora-repo-latest.noarch.rpm](https://download.postgresql.org/pub/repos/yum/reporpms/F-30/pgdg-fedora-repo-latest.noarch.rpm)  
sudo dnf -y update && sudo dnf -y install pgadmin4  
sudo systemctl start httpd && sudo systemctl enable httpd  
sudo systemctl status httpd  
sudo cp /etc/httpd/conf.d/pgadmin4.conf.sample /etc/httpd/conf.d/pgadmin4.conf  
sudo httpd -t  
sudo systemctl restart httpd  
sudo mkdir -p /var/lib/pgadmin4/ /var/log/pgadmin4/  
sudo vi /usr/lib/python3.7/site-packages/pgadmin4-web/config\_distro.py

Add at the end of file below lines:-

LOG\_FILE = ‘/var/log/pgadmin4/pgadmin4.log’  
SQLITE\_PATH = ‘/var/lib/pgadmin4/pgadmin4.db’  
SESSION\_DB\_PATH = ‘/var/lib/pgadmin4/sessions’  
STORAGE\_DIR = ‘/var/lib/pgadmin4/storage’

sudo python3 /usr/lib/python3.7/site-packages/pgadmin4-web/setup.py  
sudo chown -R apache:apache /var/lib/pgadmin4 /var/log/pgadmin4

## If SELinux running

sudo semanage fcontext -a -t httpd\_sys\_rw\_content\_t “/var/lib/pgadmin4(/._)?"  
sudo semanage fcontext -a -t httpd\_sys\_rw\_content\_t "/var/log/pgadmin4(/._)?”  
sudo restorecon -R /var/lib/pgadmin4/  
sudo restorecon -R /var/log/pgadmin4/

sudo systemctl restart httpd  
sudo firewall-cmd --permanent --add-service=http  
sudo firewall-cmd --reload

http://YOUR\_IP/pgadmin4

---

<div class="post-metadata">

**Author:** ![girishm](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@girishm](https://community.dhis2.org/u/girishm)\
**Post date:** [8 August 2019 12:43 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/15 "2019-08-08T12:43:40Z")

</div>

Thanks @MohsinAnsari. It works fine 👍

---

<div class="post-metadata">

**Author:** ![fernandoshake](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/f/9de053/32.png) [@fernandoshake](https://community.dhis2.org/u/fernandoshake)\
**Post date:** [8 January 2025 12:49 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/16 "2025-01-08T12:49:23Z")

</div>

Hi @MohsinAnsari,

I have just come across your post about DHIS 2 Installation. I see it was posted in 2019. I have Installed ubuntu 24.04 on my laptop. Are the same steps valid for this Ubuntu version?

Thanks

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [8 January 2025 18:13 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/17 "2025-01-08T18:13:50Z")

</div>

Hi @fernandoshake

Although the post has helpful information, like you mentioned it’s from 2019 so it doesn’t have the latest versions and updates. Would you kindly have a look at the official instructions from the DHIS2 Documentation: [Manual install on Ubuntu - DHIS2 Documentation](https://docs.dhis2.org/en/manage/getting-started/manual-install-on-ubuntu.html)

For now, I will close this topic post because it’s old; however, if you have any questions about the instructions or the information from the documentation, please feel free to create a new topic.

Thank you for your understanding. I hope the docs page helps. Again, please feel free to create a new topic post if anything is not clear.

Thanks!

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [8 January 2025 18:13 UTC](https://community.dhis2.org/t/dhis-war-deployment-issue/36534/18 "2025-01-08T18:13:54Z")

</div>

Closed because topic is old.

Please refer to the latest instructions: [Manual install on Ubuntu - DHIS2 Documentation](https://docs.dhis2.org/en/manage/getting-started/manual-install-on-ubuntu.html)
