java.lang.NoClassDefFoundError: org/eclipse/jetty/util/ssl/SslContextFactory$Server

1,314 views
Skip to first unread message

Slawek Mazur

unread,
Feb 23, 2022, 12:44:39 PM2/23/22
to wiremock-user
Hi All

I just pulled in latest version as such:

testImplementation "com.github.tomakehurst:wiremock-jre8:2.32.0"

when I try to run the test case with @WireMockTest I keep getting 

java.lang.NoClassDefFoundError: org/eclipse/jetty/util/ssl/SslContextFactory$Server
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.getServerConstructor(JettyHttpServerFactory.java:37)


refreshing dependencies, cleaning up caches, .tmp nothing helps. Class cannot be loaded

 Screenshot 2022-02-23 at 18.41.25.png

Screenshot 2022-02-23 at 18.41.39.png

Screenshot 2022-02-23 at 18.43.12.png

This is super weird as I don't have any other jetty dependency on the class-path and everything is pulled by WireMock.


Best
SM

Achim Abeling

unread,
Oct 17, 2022, 8:00:13 AM10/17/22
to wiremock-user
I had the same problem and solved it by using the standalone dependency: wiremock-jre8-standalone
Message has been deleted

Achim Abeling

unread,
Oct 17, 2022, 9:08:03 AM10/17/22
to wiremock-user
Update:
I then had problems with the wiremock-jre8-standalone since the maven enforcer plugin complained about duplicate classes.
I got it working with the wiremock-jre8 by adding the dependencies
org.eclipse.jetty:jetty-util and
org.eclipse.jetty:jetty-io

I also found in my project older jetty-util dependency definitions. By actively adding the dependencies with version 9.4.48.v20220622 (using wiremock 2.34.0) it worked.
Reply all
Reply to author
Forward
0 new messages