Thursday, April 30, 2015

Jetty missing NonBlockingThread

Got this error trying to start up a Jetty server:
2015-04-30 08:57:35.111:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.ServerConnector$ServerConnectorManager@5a24ad9b: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/NonBlockingThread
The fix was to add a Maven dependency for jetty-util. Apparently, jetty-server doesn't include it as a dependency; it just fails at runtime if it's not there.

Java version incompatibility

Got this error message when I posted a JSON message to a little REST server I'm starting:
java.lang.UnsupportedClassVersionError: org/json/JSONObject : Unsupported major.minor version 52.0
It's because the newest version of the org.json library only works with Java 8 and I'm on Java 7. Why it doesn't detect this at compile time, I don't know.
Fix was to roll back from version 20141113 to 20140107.