https://linen.dev logo
#help
Title
# help
j

Joonas Krohn

11/27/2023, 12:09 PM
Hi! After Spring Boot 3.2 upgrade WireMock 3.3.1 no longer works with JUnit 4.13.2:
Copy code
java.lang.IncompatibleClassChangeError: class org.eclipse.jetty.http2.server.HttpChannelOverHTTP2 has interface org.eclipse.jetty.server.HttpChannel as super class
Stacktrace in the thread.
Copy code
java.lang.IncompatibleClassChangeError: class org.eclipse.jetty.http2.server.HttpChannelOverHTTP2 has interface org.eclipse.jetty.server.HttpChannel as super class
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at org.eclipse.jetty.http2.server.AbstractHTTP2ServerConnectionFactory.<init>(AbstractHTTP2ServerConnectionFactory.java:82)
	at org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory.<init>(HTTP2ServerConnectionFactory.java:53)
	at org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory.<init>(HTTP2CServerConnectionFactory.java:53)
	at org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory.<init>(HTTP2CServerConnectionFactory.java:48)
	at com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer.createHttpConnector(Jetty11HttpServer.java:53)
	at com.github.tomakehurst.wiremock.jetty.JettyHttpServer.<init>(JettyHttpServer.java:89)
	at com.github.tomakehurst.wiremock.jetty11.Jetty11HttpServer.<init>(Jetty11HttpServer.java:44)
	at com.github.tomakehurst.wiremock.jetty.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:81)
	at com.github.tomakehurst.wiremock.junit.WireMockRule.<init>(WireMockRule.java:36)
	at com.github.tomakehurst.wiremock.junit.WireMockRule.<init>(WireMockRule.java:32)
t

Tom

11/27/2023, 12:59 PM
Have you tried standalone?
j

Joonas Krohn

11/27/2023, 12:59 PM
I have not.
t

Tom

11/27/2023, 1:00 PM
Would definitely suggest that, in that case!
👌 1
👍 1
j

Joonas Krohn

11/27/2023, 1:00 PM
Ok, we'll take a look into that. Thanks!
👍 1
j

Julian

11/30/2023, 12:11 PM
We have the same issue with spring boot 3.2 and wiremock 3.3.1
a

Alex Gutjahr

12/05/2023, 9:40 AM
Is this being tracked somewhere? I experienced the same issue and would like to get notified once this is supported.
t

Tom

12/05/2023, 9:57 AM
It is supported - just just the standalone JAR
a

Alex Gutjahr

12/05/2023, 9:58 AM
Does this imply that the non-standalone will never work with it?
t

Tom

12/05/2023, 10:00 AM
No, but there will always be times when you’ve got clashing versions of core dependencies between Spring and WireMock. Impossible to avoid when people are running a variety of Spring versions. So in those cases the standalone (shaded) JAR allows both sets of dependency versions to cohabit.
a

Alex Gutjahr

12/05/2023, 10:01 AM
I see your point, I just don't want to run the standalone process and I have no rush to upgrade to Spring Boot 3.2. I am just interested to track when support will land in the non-standalone part - whenever that is.
t

Tom

12/05/2023, 10:01 AM
You don’t have to run the standalone JAR as a process, just use it as a dependency
Nothing materially changes, other than that you have to download a bigger JAR file
a

Alex Gutjahr

12/05/2023, 10:02 AM
Ah, I see, I did not know this and assumed that it always has to run separately. Then I surely give it a spin, thanks, Tom!
👍 1
j

Joao Guilherme Pan

12/06/2023, 12:30 PM
I had to do this in order to fix this issue for me
72 Views