wiremock icon indicating copy to clipboard operation
wiremock copied to clipboard

Wiremock standalone 3: NoSuchMethodError

Open samuelstein opened this issue 1 year ago • 8 comments

Proposal

After switching maven artifact group from com.github.tomakehurst to org.wiremock the following exception occurred:

java.lang.NoSuchMethodError: 'void wiremock.org.eclipse.jetty.server.AbstractConnectionFactory.<init>(java.lang.String[])'

Reproduction steps

I'm using Spring Boot 3.2.2, JUnit 5 (4.2.21) and wiremock standalone 3.4.2.

References

The wiremock server is instanciated in a test class with the following annotation: @SpringBootTest @WireMockTest(httpPort = 80)

samuelstein avatar Mar 01 '24 09:03 samuelstein

Have the same trouble, is it even compatible?

vdonets-dev avatar Mar 15 '24 13:03 vdonets-dev

Hi, I am struggling to reproduce this using Spring Boot 3.2.2 and wiremock standalone 3.4.2. Do you have an example project that demonstrates this or more details of the tests you are running to help me diagnose the issue?

leeturner avatar May 10 '24 12:05 leeturner

Hi, we are planning on releasing 3.6.0 this week if possible. If you could come back with any additional information we might be able to look into this before the next release.

leeturner avatar May 20 '24 08:05 leeturner

With Spring boot 3.2.5, Java 21 and wiremock-standalone in version 3.5.4 the problem still exists in my project

samuelstein avatar May 21 '24 13:05 samuelstein

Hi @samuelstein Many thanks for the update. I have updated my test project to the versions in your last comment and I still can't reproduce this issue. Would it be possible to post some code or an example project that demonstraites the issue so we can see what is happening for you?

Also, on a releated note, we now have a jetty 12 version of WireMock that should work with Spring Boot 3.x.x. I am not sure if you have tried this at all? The reason people were using WireMock Standalone with SB 3.x.x was because they updated to jetty 12 in the 3.x.x release of SB and WireMock was originally on jetty 11.

https://mvnrepository.com/artifact/org.wiremock/wiremock-jetty12/3.5.4

Example project here - https://github.com/wiremock/wiremock-examples/tree/main/spring-boot/spring-boot-3/wiremock-jetty-12

leeturner avatar May 22 '24 08:05 leeturner