WebUpd8 Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)

I am trying to use DHIS 2 Tools to set up DHIS 2 on Ubuntu 18.04. This worked fine until April when the WebUpd8 Oracle Java (JDK) 8 Installer PPA was discontinued (see Oracle Java (JDK) 8 Installer PPA (DISCONTINUED) : “WebUpd8” team).

I have tried installing Amazon Corretto as an alternative (see Amazon Corretto 8 Installation Instructions for Debian-Based, RPM-Based and Alpine Linux Distributions - Amazon Corretto).

I have also added the following to /etc/profile:

export JAVA_HOME="/usr/lib/jvm/java-1.8.0-amazon-corretto/jre"
export JRE_HOME="/usr/lib/jvm/java-1.8.0-amazon-corretto"
export PATH=$PATH::$JAVA_HOME/bin

and the following to /var/lib/dhis2/dhis2/bin/setenv.sh:

export JAVA_HOME="/usr/lib/jvm/java-1.8.0-amazon-corretto/jre"
export JRE_HOME="/usr/lib/jvm/java-1.8.0-amazon-corretto"

but am getting the following errors in the log:

SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
SEVERE: Exception sending context initialized event to listener instance of class [org.hisp.dhis.system.startup.StartupListener]
SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file May 13, 2019 9:08:57 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/dhis2] startup failed due to previous errors

and DHIS 2 fails to start.

Are there any suggestions for dealing with this specific issue or for installing alternative versions of Java in general?

Thanks, Paul

1 Like

Hi @prcleary,

I would recommend to try with openjdk-8-jdk

In the meantime, I’ll raise the issue with the maintainer of the dhis2 tools repository, so that we can fix the problem there.

Thanks,
Phil

1 Like

Thanks Paul (and Phil)

The dhis2-tools package doesn’t actually have an formal dependency on any particular jvm version. In fact it depends on tomcat8, which brings in its own dependencies.

Generally it is a good idea to install the jvm prior to installing the dhis2-tools so that you can explicitly choose which jvm to use.

I have just fixed the example install script here dhis2-tools/install.sh at bionic · dhis2/dhis2-tools · GitHub. As you can see, it installs the openjdk-8- jre-headless package prior to installing the tools. Previously it was installing oracle from the webupd repo. Probably this is what you were doing. Any please try that and let me know if there are any problems.

Cheers
Bob

BTW the tools have worked very well for a number of years, but there are good reasons to move to something more sophisticated for very large or very sensitive (tracker) installations. I am working on some new guidelines over the next few weeks so expect that soon. Meanwhile will continue to support dhis2-tools for the short/medium term.

1 Like

Thanks all. I just ran the install.sh script from the bionic branch of the dhis2-tools repo and checked only the correct version of Java was installed with update-alternatives --config java but I am still getting Java errors which prevent DHIS 2 from starting. I can’t upload files directly but the catalina.out file can be found in my Google Drive here: https://drive.google.com/open?id=1bX3liDDwVHXo2vHMG4Mq0Qv9uplxw9kQLZ1_YqcTTNk

1 Like

That looks like java version >8

1 Like

Thanks. I haven’t installed any later versions of Java (this is a fresh Ubuntu 18.04 install). There are references to Jre9Compat in the log but this is part of Tomcat 8.5.

It is using OpenJDK version 8.

sudo update-alternatives --config java

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/
java
Nothing to configure.

The Java version is:

java -version
openjdk version “1.8.0_212”
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

I’ve uninstalled all Java/Tomcat packages to be sure and reinstalled OpenJDK 8 but no joy.

I just noticed that in the log the PostGIS extension hadn’t been created. I will try a manual installation instead.

1 Like