https://linen.dev logo
#wiremock-java
Title
# wiremock-java
o

Oleg Nenashev

08/30/2023, 11:34 AM
@Tom FYI we seem to have a binary compatibility issue with the Webhook Extension from 2.35.0. Maybe we'd like to have a bridge API in WireMock 3.1.0
Copy code
13:27:30.951 [docker-java-stream--1816214948] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR:   at wiremock.Run.main(Run.java:23)
13:27:30.952 [docker-java-stream--1816214948] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: Caused by: java.lang.NoSuchMethodError: 'void com.github.tomakehurst.wiremock.extension.responsetemplating.TemplateEngine.<init>(java.util.Map, java.lang.Long, java.util.Set)'
13:27:30.953 [docker-java-stream--1816214948] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR:   at org.wiremock.webhooks.Webhooks.<init>(Webhooks.java:62)
13:27:30.954 [docker-java-stream--1816214948] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR:   at org.wiremock.webhooks.Webhooks.<init>(Webhooks.java:67)
13:27:30.955 [docker-java-stream--1816214948] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR:   ... 23 more
13:28:29.702 [main] ERROR tc.wiremock/wiremock:3.0.0-1 - Could not start container
t

Tom

08/30/2023, 11:35 AM
You mean trying to use webhooks 2.x with WM 3.x?
o

Oleg Nenashev

08/30/2023, 11:36 AM
Yes
Just caught it in the compatibility test
I will just document it if there is a big scope for compatibility patch that would help users
I also do not like that with the 3.0.0 extension Looking whether a test framework bug or WireMock one
Copy code
14:05:34.608 [main] INFO  org.testcontainers.containers.wait.strategy.HttpWaitStrategy - /strange_babbage: Waiting for 60 seconds for URL: <http://localhost:51446/__admin/mappings> (where port 51446 maps to container port 8080)
14:05:35.464 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hc/client5/http/io/HttpClientConnectionManager
14:05:35.464 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.lang.Class.forName0(Native Method)
14:05:35.465 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.lang.Class.forName(Unknown Source)
14:05:35.466 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at com.github.tomakehurst.wiremock.extension.Extensions.loadClass(Extensions.java:172)
14:05:35.467 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
14:05:35.467 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
14:05:35.467 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
14:05:35.468 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
14:05:35.468 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(Unknown Source)
14:05:35.469 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Unknown Source)
14:05:35.470 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
14:05:35.471 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
14:05:35.471 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
14:05:35.472 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
14:05:35.472 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
14:05:35.472 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
14:05:35.473 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at com.github.tomakehurst.wiremock.extension.Extensions.load(Extensions.java:70)
14:05:35.474 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:92)
14:05:35.474 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:70)
14:05:35.475 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:69)
14:05:35.476 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at wiremock.Run.main(Run.java:23)
14:05:35.477 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: Caused by: java.lang.ClassNotFoundException: org.apache.hc.client5.http.io.HttpClientConnectionManager
14:05:35.477 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
14:05:35.478 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
14:05:35.478 [docker-java-stream--1372179660] INFO  org.wiremock.integrations.testcontainers.WireMockContainerExtensionsWebhookTest - STDERR: 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
@Tom ^ AFAICT the Webhooks extension for 3.0.0 is not a shaded JAR. There is no relocated Apache HTTP Client, and it looks like the JAR is half-made to say at least. Filing a bug
l

Lee Turner

09/05/2023, 2:21 PM
With regards to the shadowJar issue, was the fix to pin the order of jar creation pushed before version
3.0.1
of the webhooks extension was released ? I am just in the process of upgrading a few standalone/docker setups we are using and got the same error -
java.lang.NoClassDefFoundError: org/apache/hc/client5/http/io/HttpClientConnectionManager
I downloaded the
3.0.1
jar from maven and it does not contain all metadata and shaded dependencies. Just built
3.0.2
locally and that works fine when built as a shadowJar
o

Oleg Nenashev

09/05/2023, 2:58 PM
Hmm. FYI @Tom ^ maybe something regressed in the shading order fix