Problems in tomcat startup for fresh installation

These are the warnings I am getting when I shutdown tomcat, I am on tomcat7, PostgreSQL 9.5, PostGIS -2.2, DHIS 2.3.1, localist:8080/Root also shows that it doesn’t exist. Please help.

This is the installation methodology I used
https://sites.google.com/view/dhis2installation

Using CATALINA_BASE:   /home/dhis-min/tomcat
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /home/dhis-min/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-8-openjdk-amd64/
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:00:25 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Tomcat stopped
1 Like
Using CATALINA_BASE:   /home/dhis-min/tomcat
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /home/dhis-min/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-8-openjdk-amd64/
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jul 08, 2019 11:15:50 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop: 
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
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.catalina.startup.Bootstrap.stopServer(Bootstrap.java:343)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:430)
1 Like

Hi @Minhaas,

at first glance I see two things:

  1. You are using Postgres 9.5, the minimum version now is 9.6. But this is not your immediate problem it seems.
  2. Your logs complain about not having access to directories. This is an indication that your read and write permission for these folders is not correct. Make sure the user running tomcat has correct access to these directories.
1 Like

Thank you so much for the assistance, the deeper problem was associated with

  1. Postgres 9.5
  2. Out of shared memory error, both of which were solved with the help of other community posts.

dhis2 works like a charm.

For thr second error, I had to navigate to the postgres.conf file and change max_locks_per_transaction to 1024, this made my PostgreSQL work.

1 Like