Hi,
The problem is the servlet container version, not Java.
The NetXMS 6.2 web client (nxmc-6.2.0.war) is built against the Jakarta Servlet API (jakarta.servlet.* namespace) and requires a container that supports it. You are running Tomcat 9.0.58, which still uses the older javax.servlet.* namespace. Because of that, Tomcat 9 cannot load the application's context listeners, which is exactly the "One or more listeners failed to start" / "Context startup failed" error you see.
The ClassCastException about ObjectStreamClass$Caches is a harmless secondary warning. It comes from Tomcat's cleanup routine running on a newer JDK while it tears down the already-failed context - it is not the cause. That is also why switching from JDK 17 to 21 made no difference; the JDK was never the issue.
To fix it, deploy the WAR on a container that supports the Jakarta Servlet API:
Tomcat 10.1 or later - on Ubuntu use the tomcat10 package, webapps directory /var/lib/tomcat10/webapps.
Jetty 11 or later is also fine (Jetty 11/12 support the Jakarta Servlet API).
Java 17 or 21 works with either. Do not run it under Tomcat 9 - the javax vs jakarta namespace difference cannot be bridged by a config change or a different JDK.