0
votes

I am trying to run jetty 9.2.4 version and I get the following exception. the same server set up works fine on my local set up (mac), staging environment (linux, ubutnu) but does not work on another server I am trying to set this up on. Pleas suggest what could be wrong. I am almost clueless.

:/WEBCHAT/jetty-distribution-9.2.4.v20141103# java -jar start.jar 2014-12-17 08:24:11.695:INFO::main: Logging initialized @1221ms 2014-12-17 08:24:11.947:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended. See documentation at http://www.eclipse.org/jetty/documentation/current/startup.html 2014-12-17 08:24:12.848:INFO:oejs.Server:main: jetty-9.2.4.v20141103 2014-12-17 08:24:12.879:INFO:oejs.AbstractNCSARequestLog:main: Opened /WEBCHAT/jetty-distribution-9.2.4.v20141103/logs/2014_12_17.request.log 2014-12-17 08:24:12.943:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/WEBCHAT/jetty-distribution-9.2.4.v20141103/webapps/] at interval 1 2014-12-17 08:24:29.188:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.annotations.ServletContainerInitializersStarter@29b95cf5: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/WebSocket$OnTextMessage java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/WebSocket$OnTextMessage at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:510) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:441) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)

1

1 Answers

1
votes

The class org/eclipse/jetty/websocket/WebSocket$OnTextMessage is not part of Jetty 9.

That is a Jetty 7 and Jetty 8 provisional class (those classes existed during the evolution of WebSocket in Jetty through the earliest drafts to the nearly complete and finalized WebSocket spec.)

Jetty 9 took the finalized RFC-6455 and the JSR-356 specs and implemented them.

This means a wholesale fix for WebSocket, the native API, the standard API, the protocol, new client specs, new server specs, and all up to date additional specs around WebSocket (such as the various WebSocket extensions).

You cannot use a webapp developed against org/eclipse/jetty/websocket/WebSocket$OnTextMessage in Jetty 9, that's just not going to work.