Could someone please assist me in resolving this i...
# general
Could someone please assist me in resolving this issue? I am attempting to run the Docker command by incorporating an extension, following the guidelines provided at: - WireMock Docker documentation: - Extension repository: I have placed the extension JAR file in the "extensions" folder on my local machine, and verified the presence of the extension's classname within the JAR (please refer to the attached screenshot). Here is the Docker command I used:
docker run -it --rm -p 8080:8080 --name wiremock -v $PWD/extensions:/var/wiremock/extensions wiremock/wiremock --extensions org.wiremock.extensions.state.extensions.RecordStateEventListener
However, I encountered the following error:
Exception in thread "main" java.lang.ClassNotFoundException: org.wiremock.extensions.state.extensions.RecordStateEventListener
You shouldn't register the parts of this extension individually - you should register the whole extension. The extension uses the
extension, thus it should be auto detected when it's on the classpath (which should be the case if I interpret your cmdline correctly). Can you start wiremock without
--extensions ...
and with
? The detected extensions should be printed out. see also:
@Dirk Bolte ok. but i could not find the extension listed after start:
i do not see the jar in the location inside docker container
The cmdline and directory structure looks ok. As you have a snapshot jar I assume that you built the extension yourself. Can you try the following commands in the upmost directory of the repository checkout?
Copy code
./gradlew clean
./gradlew shadowjar
run -it --rm -p 8080:8080 --name wiremock -v $PWD/build/libs:/var/wiremock/extensions wiremock/wiremock -- --global-response-templating --verbose
Locally, I see the extension registered properly:
many thanks. let me try