A twist to the http 404 not found error

Hello, I have read through the similar posts but cant seem to find a solution and an exact match to the issue. I am trying to install DHIS2 on Windows server 2016 with Postgresql 14.2, Apache Tomcat 10.0.20, JDK-18, DHIS2 2.37.6. After installation, the tomcat application manager shows dhis is running, but http://localhost:8080/dhis is giving the below error and when I check the database, the table have not been created:

HTTP Status 404 - Not Found
Type Status Report

Message The requested resource [/dhis/] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/10.0.20

the dhis.conf file has these settings:

# Hibernate SQL dialect
connection.dialect = org.hibernate.dialect.PostgreSQLDialect
# JDBC driver class
connection.driver_class = org.postgresql.Driver
# Database connection URL
connection.url = jdbc:postgresql:dhis2
# Database username
connection.username = dhis
# Database password
connection.password = password
# Database schema behavior, can be validate, update, create, create-drop
connection.schema = update

# Encryption password (sensitive)
 encryption.password = 

Attaching the Catalina log in the comment below. Please help resolve the issue.

Thank you

Click here for Catalina log:

05-May-2022 08:21:23.225 INFO [Thread-3] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler [“http-nio-8080”]
05-May-2022 08:21:23.490 INFO [Thread-3] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
05-May-2022 08:21:23.562 INFO [Thread-3] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler [“http-nio-8080”]
05-May-2022 08:21:23.578 INFO [Thread-3] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler [“http-nio-8080”]
05-May-2022 08:21:39.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/10.0.20
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 31 2022 14:24:36 UTC
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.0.20.0
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows Server 2016
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-18.0.1
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 18.0.1+10-24
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Program Files\Apache Software Foundation\Tomcat 10.0
05-May-2022 08:21:39.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 10.0
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 10.0
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 10.0
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 10.0\temp
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 10.0\conf\logging.properties
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: abort
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4096m
05-May-2022 08:21:39.119 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [C:\Program Files\Apache Software Foundation\Tomcat 10.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk-18.0.1\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk-18.0.1\bin;C:\Program Files\PostgreSQL\14\bin;C:\Program Files\PostgreSQL\psqlODBC\bin;C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\WindowsApps;.]
05-May-2022 08:21:39.449 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“http-nio-8080”]
05-May-2022 08:21:39.480 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [593] milliseconds
05-May-2022 08:21:39.527 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
05-May-2022 08:21:39.527 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.0.20]
05-May-2022 08:21:39.543 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\dhis.war]
05-May-2022 08:21:54.806 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
05-May-2022 08:21:54.912 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\dhis.war] has finished in [15,368] ms
05-May-2022 08:21:54.913 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\docs]
05-May-2022 08:21:54.943 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\docs] has finished in [29] ms
05-May-2022 08:21:54.943 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\host-manager]
05-May-2022 08:21:54.997 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\host-manager] has finished in [53] ms
05-May-2022 08:21:54.997 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\manager]
05-May-2022 08:21:55.030 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\manager] has finished in [33] ms
05-May-2022 08:21:55.030 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\ROOT]
05-May-2022 08:21:55.049 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\ROOT] has finished in [19] ms
05-May-2022 08:21:55.052 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-8080”]
05-May-2022 08:21:55.106 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [15620] milliseconds

Hi @WaluQ,
Thank you for your post! The only thing that I was able to find from your posts is:

Does it work when you go to http://localhost:8080/dhis (without the HTTPS?) Did you enable SSL and expect it to work otherwise http should work rather than https.

If you are using HTTPS then I think you might need to review the configuration to enable SSL (docs here: Installation - DHIS2 Documentation)

Hope this helps! :+1:

Please don’t share sensitive info (I know this is just a test instance but it’s important to keep this in mind for any future post). Thanks! :saluting_face:

1 Like

I have been trying it on http://localhost:8080/dhis/ actually, I think I added the ‘s’ from typing habits. It’s not working on http://localhost:8080/dhis/. Thanks for the response.

1 Like

If you get a 404 it means that for some reason the dhis.war file failed to deploy.

Usually this would have been accompanied by a long stream of errors in the log file. In you r instance we are seeing nothing. I dont know too much about windows but I can say the software versions you are using are higher than what I am familiar with. tomcat8 with openjdk 11 and postgresql 13 are more common. I would try again with jdk 11 and tomcat 9 and see if the logs are still quiet.

Can you see under webapps directory has the war file been unpacked into a dhis directory.

There are also logs under DHIS2_HOME/logs where you might find something. (look for dhis.log)

Regards
Bob

2 Likes

Thank you @bobj for the response and @vikwato for solving the issue. @vikwato figured out it was something to do with the Java version and used JDK11 with TOmacat 8.5 and the instance is now running.

Thank you

2 Likes

No problem @WaluQ

1 Like

Please how did you go about it

Nothing under my dhis2/webapps

@bruh it’s not clear what issue you are facing, so please create a new post and describe the issue you are facing as well as share environment info as well as logs.

Thank you!