Start fails after upgrade to Ubuntu 22.04.1 LTS

Today I update by system to Ubuntu 22.04.1 LTS. Since that I did not manage to start my (previously working) xwiki installation.
In cataline.out I find only

[2022-08-29 16:26:31] [crit] One or more listeners failed to start. Full details will be found in the appropriate container log file
[2022-08-29 16:26:31] [crit] Context [/xwiki] startup failed due to previous errors

I tried to find the reason but did not succeed.
How could I try to locate the problem?
Thanks for your support!

Hi, see https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationTomcat/#HSEVERE:ErrorlistenerStart

Hi,
thanks for the quick reply.
With the logging I get now the following message:

[2022-08-29 18:33:08] [crit] Error configuring application listener of class [org.xwiki.container.servlet.XWikiServletContextListener]
[2022-08-29 18:33:08] [crit] java.lang.UnsupportedClassVersionError: org/xwiki/container/servlet/XWikiServletContextListener 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 (unable to load class [org.xwiki.container.servlet.XWikiServletContextListener])

If I run
apt install default-jre
the result is
default-jre ist schon die neueste Version (2:1.11-72build2) (english: latest version is already installed)

Hi,

Can you tell what’s version of Java is installed? java -version. And make sure that you’ve also installed JDK.

openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

Not sure if JDK is installed. I wil check later today.

And the version of XWiki?

How can I check that without starting it?
I think I updated 2-3 weeks ago. So I think it is 14.6.x.

But I did apt-get update/upgrade. So it may be updated to latest.

Go to webapps\xwiki\WEB-INF, and in the file version.properties you’ll see the version.

14.6

Well, the version of Java is okay for XWiki, and what version of Tomcat do you use?

[2022-08-28 20:49:39] [info] NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-OPENS=java.rmi/sun.rmi.transport=ALL-UNNAMED
[2022-08-28 20:49:47] [warning] No rules found matching [Server/Service/Valve]
[2022-08-28 20:49:48] [info] Server version name:   Apache Tomcat/9.0.31 (Ubuntu)
[2022-08-28 20:49:48] [info] Server built:          Jul 20 2022 18:09:00 UTC
[2022-08-28 20:49:48] [info] Server version number: 9.0.31.0
[2022-08-28 20:49:48] [info] OS Name:               Linux
[2022-08-28 20:49:48] [info] OS Version:            5.4.0-125-generic
[2022-08-28 20:49:48] [info] Architecture:          amd64
[2022-08-28 20:49:48] [info] Java Home:             /usr/lib/jvm/java-11-openjdk-amd64
[2022-08-28 20:49:48] [info] JVM Version:           11.0.16+8-post-Ubuntu-0ubuntu120.04
[2022-08-28 20:49:48] [info] JVM Vendor:            Ubuntu
[2022-08-28 20:49:48] [info] CATALINA_BASE:         /var/lib/tomcat9
[2022-08-28 20:49:48] [info] CATALINA_HOME:         /usr/share/tomcat9
[2022-08-28 20:49:48] [info] Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
[2022-08-28 20:49:48] [info] Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
[2022-08-28 20:49:48] [info] Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

This clearly means that your XWiki version requires Java 11 (55.0) but that your java runtime only supports Java 8 (52.0).

Now:

Also clearly shows that your Tomcat server uses Java 11…

So I’m at a loss :slight_smile:

Then I assume there’s a conflict with java compiler version. But did you have before upgrading XWiki the JDK 11 installed, or it’s an older version, and you’d updated it also? Please, run the command javac -version. And if the version isn’t 11, so run the following command sudo update-alternatives --config javac and choose the JVM version.

Cause from the error, we can see

  • 55 = Java 11
  • 52 = Java 8

What’s important is the java version used by Tomcat and the logs provided say java 11 (you can have several java version on your system and it doesn’t matter, all that matter is the one used by Tomcat).

Yes, but that’s can raise the problem which java is used by default. For this case (problem) it can also be an error in the environmental variable that’s pointed to the bin folder.

I don’t see how since it says that the Java version used is Java 11:

[2022-08-28 20:49:48] [info] Java Home:             /usr/lib/jvm/java-11-openjdk-amd64
[2022-08-28 20:49:48] [info] JVM Version:           11.0.16+8-post-Ubuntu-0ubuntu120.04

Is the property JAVA_HOME in file /etc/default/tomcat9 commented, and if not which value do you have ?

If you don’t need is for something else, it might be interesting to completely uninstall Java 8 (should be a package that starts with openjdk-8-) to make sure it cannot be used in any way.

It is set with
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

So this may cause the problem?

javac -version says:

Der Befehl 'javac' wurde nicht gefunden, kann aber installiert werden mit:
apt install default-jdk              # version 2:1.11-72build2, or
apt install openjdk-11-jdk-headless  # version 11.0.16+8-0ubuntu1~22.04
apt install openjdk-17-jdk-headless  # version 17.0.3+7-0ubuntu0.22.04.1
apt install ecj                      # version 3.16.0-1
apt install openjdk-18-jdk-headless  # version 18~36ea-1
apt install openjdk-8-jdk-headless   # version 8u312-b07-0ubuntu1

(English: Command was not found)

Seems that since the Ubuntu update something is messed up with my java installation…

The path is messed up, JAVA_HOME - 8, where’s during start up Java 11 is used. I can advise use sudo update-alternatives --config java

Yes, this tells Tomcat to use /usr/lib/jvm/java-8-openjdk-amd64 as JVM, so Java 8. You should change it to Java 11 location (should look like /usr/lib/jvm/java-11-openjdk-amd64/). Commending the property might work too (use the default one) but might be a bit less stable (the default might change into something XWiki does not like).