0

When Tomcat loads my war, I get this error:

Exception in thread "ClientMessageReceptor0" java.lang.NoClassDefFoundError: java/net/Inet6Address
        at org.jacorb.orb.iiop.IIOPAddress.getNetworkInetAddresses(IIOPAddress.java:675)
        at org.jacorb.orb.iiop.IIOPAddress.getLocalHost(IIOPAddress.java:591)
        at org.jacorb.orb.iiop.IIOPAddress.getLocalHostAddress(IIOPAddress.java:574)
        at org.jacorb.orb.listener.SSLListenerUtil.processException(SSLListenerUtil.java:73)
        at org.jacorb.orb.iiop.IIOPConnection.handleCommFailure(IIOPConnection.java:77)
        at org.jacorb.orb.etf.StreamConnectionBase.read(StreamConnectionBase.java:139)
        at org.jacorb.orb.giop.GIOPConnection.getMessage(GIOPConnection.java:389)
        at org.jacorb.orb.giop.GIOPConnection.receiveMessagesLoop(GIOPConnection.java:541)
        at org.jacorb.orb.giop.GIOPConnection.receiveMessages(GIOPConnection.java:533)
        at org.jacorb.orb.giop.MessageReceptor.doWork(MessageReceptor.java:69)
        at org.jacorb.util.threadpool.ConsumerTie.run(ConsumerTie.java:60)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [java.net.Inet6Address]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1375)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1226)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)

Our application uses Tomcat v9.0.41 and JDK 1.8.0_111 . This same combination works for others in my team and also it worked for me sometime back. I'm not sure what changed now. I have looked at other similar posts and they suggest mismatch between Tomcat and JDK version. But above combination of Tomcat and JDK works for others.

  1. I have removed all other JDK and JRE version on my system.
  2. Ensured JAVA_HOME points to JDK 1.8.0_111 and PATH points to correct JRE.

Any pointers on how to debug this further? Can I turn on some logging during Tomcat startup to see what paths are being used by Tomcat? Any suggestions are highly appreciated :).

Matt
  • 68,711
  • 7
  • 155
  • 158
cppcoder
  • 1,194
  • 4
  • 16
  • 30
  • By what I know, NoClassDefFoundError means that the class MIGHT BE there but the JVM can't load it for some reason, this error will pop-up again and again no matter how much you try because it can remember which class has not been successfully loaded before hence in simple words, it rage quits. That is unless if you reinstall the JDK (again). I would suggest installing the JDK version that worked before. [Here's a link with some explanation](https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) – JumperBot_ Jul 02 '22 at 02:13
  • Is this the full stacktrace? There seems to be some more details after `this web application instance has been stopped already ...` – samabcde Jul 02 '22 at 02:55
  • 1
    @samabcde There is little bit more of stacktrace . I will share it soon. Thanks. – cppcoder Jul 02 '22 at 04:50
  • Check the tomcat logs at the time the war was deployed. This error usually means an exception was thrown from static code in the class so the JVM refuses to load the class definition. – kiwiron Jul 02 '22 at 11:37

0 Answers0