Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of docs for usage with official wiremock docker image #3

Open
typekpb opened this issue May 26, 2024 · 1 comment
Open

lack of docs for usage with official wiremock docker image #3

typekpb opened this issue May 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@typekpb
Copy link

typekpb commented May 26, 2024

Proposal

The Readme.md file should document proper usage in docker.

Reproduction steps

Having Dockerfile with contents:

FROM wiremock/wiremock:3.5.2

COPY ./extensions /var/wiremock/extensions

where ./extensions dir contains: wiremock-jwt-extension-0.1.0.jar (downloaded from: https://mvnrepository.com/artifact/org.wiremock.extensions/wiremock-jwt-extension/0.1.0)

Running the command results in error:

podman build -t foo:latest . && podman run --rm -p 8082:8080 foo:latest --verbose --extensions org.wiremock.extension.jwt.JwtExtensionFactory

STEP 1/3: FROM wiremock/wiremock:3.5.2
STEP 2/3: COPY ./wiremock /home/wiremock
--> dd63ab497386
STEP 3/3: COPY ./extensions /var/wiremock/extensions
COMMIT foo:latest
--> 92a50e4f087e
Successfully tagged localhost/foo:latest
92a50e4f087ec3e2677c0a4a15d91df5faf47c717f64a58f5cb0083a71058b40
2024-05-26 22:06:50.343 Verbose logging enabled
Exception in thread "main" java.lang.ClassCastException: class org.wiremock.extension.jwt.JwtExtensionFactory cannot be cast to class com.github.tomakehurst.wiremock.extension.Extension (org.wiremock.extension.jwt.JwtExtensionFactory and com.github.tomakehurst.wiremock.extension.Extension are in unnamed module of loader 'app')
        at com.github.tomakehurst.wiremock.extension.Extensions.load(Extensions.java:230)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
        at com.github.tomakehurst.wiremock.extension.Extensions.load(Extensions.java:80)
        at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:107)
        at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
        at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:71)
        at wiremock.Run.main(Run.java:23)

References

No response

@typekpb typekpb added the bug Something isn't working label May 26, 2024
@typekpb
Copy link
Author

typekpb commented May 26, 2024

OK, I seem to have found the working way in the meantime, usage of: https://mvnrepository.com/artifact/org.wiremock.extensions/wiremock-jwt-extension-standalone/0.1.0 with command:

podman build -t foo:latest . && podman run --rm -p 8082:8080 foo:latest --verbose

starts properly, listing the expected extensions:

extensions:                   jwt-signing-key-settings-listener,jwt-initialiser,jwt-template-helpers,response-template,webhook

Anyway, might be worth documenting in the Readme.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant