DHIS2 startup failing - Error 404


I have setup DHIS2 on AWS Ubuntu 20. Trying to start the DHIS2 server but getting 404 on tomcat interface. Tomcat logs are reading as follows:

* WARN  2022-02-23T00:06:13,733 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@222ad202 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:  (Slf4jMLog.java [C3P0PooledConnectionPoolManager[identityToken->1br9qwpan9s58fn1itcz0j|7ae0327d]-HelperThread-#1])
 org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:303) ~[postgresql-42.2.19.jar:42.2.19]
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) ~[postgresql-42.2.19.jar:42.2.19]
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) ~[postgresql-42.2.19.jar:42.2.19]
        at org.postgresql.Driver.makeConnection(Driver.java:465) ~[postgresql-42.2.19.jar:42.2.19]
        at org.postgresql.Driver.connect(Driver.java:264) ~[postgresql-42.2.19.jar:42.2.19]

Can someone please help as to what is wrong?


  1. Is postgresql running , can you connect to postgres using psql?

  2. Is it on the same server or a different server?

  3. Can you see which port postgres is listening to ? May be it’s not 5432 and you may need to edit dhis conf

1 Like