java – FakeHttpServer crashes when upgrading to Jetty 9

Question:

I'm migrating an application that used Jetty 7.4.5.v20110725 to Jetty 9.3.0.M2 using Maven . I have already updated javax.servlet-api to versão 3.1.0 .

But, I am using FakeHttpServer version 0.3.0 for testing, and there is currently no newer version. It uses the org.eclipse.jetty.server.nio.SelectChannelConnector class that used to exist until Jetty 8.x, but no longer exists in Jetty 9.

At this point, my project crashes at runtime with a NoClassDefFoundError because of the removed Jetty class that FakeHttpServer tries to use, preventing me from completing the Jetty upgrade. How can I fix this?

Note: This was also posted on StackOverflow in English: https://stackoverflow.com/q/30309677/540552

Answer:

As answered in English by Joakim Erdfelt on Stack Overflow in English, the only way out is to update the FakeHttpServer. Whether it's convincing the original authors to do it, or doing it myself.

Source: https://stackoverflow.com/a/30311559/540552

Scroll to Top