Hi Everyone, I need help in solving this problem: ...
# help
m
Hi Everyone, I need help in solving this problem: I want to generate dynamic responses but not while proxying, when replaying the responses, I want to modify the responses based on the user selections in my application for which I want to inject my custom code by implementing the ResponseTransformerV2. I am using standalone wiremock-standalone-3.3.1.jar. And when I try to run the wiremock server with custom extensions, it is throwing error saying : java -cp "wiremock-standalone-3.3.1.jar:wiremockExt/src" com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions com.emirates.wiremock.extensions.DynamicResponseTransformer Error: Main method not found in class com.github.tomakehurst.wiremock.standalone.WireMockServerRunner, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application Error: A fatal exception has occurred. Program will exit. Could you please help me how to solve this and how to run wiremock server with custom extensions?
t
In 3.x the main class has changed (to make this use case a bit simpler). Instead of
com.github.tomakehurst.wiremock.standalone.WireMockServerRunner
use
wiremock.Run
m
Thank you for the reply. Now I ran the below command :`java -cp "wiremock-standalone-3.3.1.jar" wiremock.Run --extensions com.company.wiremock.extensions.DynamicResponseTransformer` Exception in thread "main" java.lang.ClassNotFoundException: com.emirates.wiremock.extensions.DynamicResponseTransformer at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521). Seems not identifying the class, class path is correct only
t
You still need to put the extension onto the classpath somehow. Perhaps if you restore src/ to the -cp expression like you did previously it’ll work.
m
It is working now.. thank you
👍 1
204 Views