Error starting Tomcat

Hi,

**** Updates below *****
I have set-up DHIS2 on Ubuntu following the instructions from: http://dhis-2.blogspot.com/
everything seems ok, however when starting TomCat i get the error below

/usr/share/tomcat8/bin/catalina.sh: 5: export: : bad variable name

The site does not run, any thoughts?

1 Like

Made some progress, uninstalled and reinstall Tomcat… server starts but seems to have some errors
sudo -u dhis tomcat-dhis/bin/startup.sh

Using CATALINA_BASE:   /home/dhis/tomcat-dhis
Using CATALINA_HOME:   /usr/share/tomcat8
Using CATALINA_TMPDIR: /home/dhis/tomcat-dhis/temp
Using JRE_HOME:        /usr/lib/jvm/java-8-openjdk-amd64/
Using CLASSPATH:       /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
Tomcat started.
Tomcat started

tail -f tomcat-dhis/logs/catalina.out

    SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container 
    log file
    May 23, 2019 3:12:15 PM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Context [] startup failed due to previous errors
    * INFO  2019-05-23 15:12:15,583 De-registering jdbc driver: org.postgresql.Driver@7be22040 
    (StartupListener.java [localhost-startStop-1])    
    May 23, 2019 3:12:15 PM org.apache.catalina.startup.HostConfig deployWAR
    INFO: Deployment of web application archive /home/dhis/tomcat-dhis/webapps/ROOT.war has 
    finished in 66,694 ms
    May 23, 2019 3:12:15 PM org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler ["http-nio-8080"]
    May 23, 2019 3:12:15 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 66873 ms

Any assistance would be greatly appreciated

1 Like

apologies for all the reply’s … getting closer.

Seems the main part of the error (full log below) is

Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

Any thoughts ?

Sorry for the big block of error

May 23, 2019 4:17:34 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSele                                                                                                                                 ctor
INFO: Using a shared selector for servlet write/read
May 23, 2019 4:17:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1425 ms
May 23, 2019 4:17:34 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 23, 2019 4:17:34 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.32 (Ubuntu)
May 23, 2019 4:17:34 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /home/dhis/tomcat-dhis/webapps/ROOT.war
May 23, 2019 4:17:48 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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 TLD                                                                                                                                 s were found in them. Skipping unneeded JARs during scanning can improve startup                                                                                                                                  time and JSP compilation time.
* INFO  2019-05-23 16:17:52,913 System property dhis2.home not set (DefaultLocat                                                                                                                                 ionManager.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:52,921 Environment variable DHIS2_HOME points to /home/                                                                                                                                 dhis/config (DefaultLocationManager.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:53,105 File /home/dhis/config/dhis-google-auth.json doe                                                                                                                                 s not exist (DefaultLocationManager.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:53,106 Could not find dhis-google-auth.json (DefaultDhi                                                                                                                                 sConfigurationProvider.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:53,112 File /home/dhis/config/dhis-google-auth.json doe                                                                                                                                 s not exist (DefaultLocationManager.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:53,112 Could not find dhis-google-auth.json (DefaultDhi                                                                                                                                 sConfigurationProvider.java [localhost-startStop-1])
* INFO  2019-05-23 16:17:59,483 Hibernate configuration loaded: dialect: 'org.hisp.dhis.hibernate.dialect.DhisPostgresDialect', region factory: 'org.hibernate.cache.ehcache.EhCacheRegionFactory', connec       tion pool max size: 80 (DefaultHibernateConfigurationProvider.java [localhost-startStop-1])
* WARN  2019-05-23 16:18:30,349 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3b2c3820 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed n       ew resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:  (Slf4jMLog.java [C3P0PooledConnectionPoolManager[identityToken->       z8kfsxa21r2tsti1qcafjl|7d3cc9ab]-HelperThread-#0])
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:280)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
        at org.postgresql.Driver.makeConnection(Driver.java:454)
        at org.postgresql.Driver.connect(Driver.java:256)
        at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
        at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
        at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
        at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
        at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
        at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
        at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
        at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
        at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Caused by: 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 org.postgresql.core.PGStream.<init>(PGStream.java:70)
        at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
        ... 13 more
May 23, 2019 4:18:30 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
May 23, 2019 4:18:30 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
* INFO  2019-05-23 16:18:30,512 De-registering jdbc driver: org.postgresql.Driver@527cb404 (StartupListener.java [localhost-startStop-1])
May 23, 2019 4:18:30 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /home/dhis/tomcat-dhis/webapps/ROOT.war has finished in 56,238 ms
May 23, 2019 4:18:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
May 23, 2019 4:18:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 56397 ms
1 Like