Opened 3 months ago

Closed 2 months ago

#2379 closed defect (fixed)

Re3gistry fails due tomcat9 not supporting java8

Reported by: omartinez Owned by: osgeolive@…
Priority: critical Milestone: OSGeoLive15.0
Component: OSGeoLive Keywords: re3gistry tomcat
Cc: osgeolive@…

Description

I’m updating the Re3gistry installer script. Re3gistry is a java8 software and requires deploying two apps into tomcat (re3gistry2 and re3gistry2API). I made some changes in the installer but arrived at the following error.

-Jul-2022 18:49:51.207 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet [jsp] threw exception
        java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/compiler/env/INameEnvironment has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
                at java.lang.ClassLoader.defineClass1(Native Method)
                at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
                at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
                at java.net.URLClassLoader.access$100(URLClassLoader.java:74)

After some research, I found out that tomcat9 looks like it does not have support for version 52 (java 8) in Ubuntu 22.04 LTS. If I’m not wrong, OSGeo Live is based on this version. A thread about this issue:

https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1972829

I’m not sure how to approach this issue, if it should imply changes in OSGeo Live base version or if we should try to install a different tomcat version in the re3gistry installer or try a workaround as it is explained in the last thread.

Thanks for your help in advance.

Change history (8)

comment:1 by edso, 3 months ago

surely easiest would be to upgrade disc/system jre from java8 LTS to java11 LTS. personally i'd say it's about time. lot's of current libraries already do not support java8 anymore. newer runtimes run older bytecode of course.

for an overview of release/support dates

https://www.oracle.com/java/technologies/java-se-support-roadmap.html

question is really, os using java8 just precaution or are there other (may be older?) java software packages on the disc acting up with jre newer than 8?

comment:2 by kalxas, 3 months ago

Cc: osgeolive@… added
Priority: normalcritical

comment:3 by kalxas, 3 months ago

The initial reports says: "Re3gistry is a java8 software" so upgrading Java will not help in this case.

In OSGeoLive 14 we also shipped tomcat9 with java8

https://github.com/OSGeo/OSGeoLive/blob/14.0.0/bin/service_tomcat.sh#L40

comment:4 by kalxas, 3 months ago

Another Re3gistry issue is that tomcat-solr is no longer available as a debian package in Ubuntu Jammy.

comment:5 by kalxas, 2 months ago

I have created ticket #2387 to track progress on Java 8 + Tomcat 9 issue.

comment:6 by kalxas, 2 months ago

Please apply this fix in your VM and try again:

https://github.com/OSGeo/OSGeoLive/commit/43773534c829b4ab14949b051e038672314e5906

It has worked fine with 52N SOS.

comment:7 by omartinez, 2 months ago

I confirm that I've been able to start the re3gistry app in the last nightly (build162) after executing the install_re3gistry.

I will update as soon as possible the install_re3gistry.sh script with minor changes (they are not related to this issue) and I hope this should be enough to have the re3gistry working.

Thank you so much for your help.

comment:8 by kalxas, 2 months ago

Resolution: fixed
Status: newclosed

Thank you for the feedback, I will wait for your pull request, I consider this issue closed.

Note: See TracTickets for help on using tickets.