:wave: Hello, team! I am getting below error, plea...
# wiremock-java
a
šŸ‘‹ Hello, team! I am getting below error, please help me to solve it
Copy code
Exception in thread "main" com.github.tomakehurst.wiremock.common.FatalStartupException: Jetty 11 is not present and no suitable HttpServerFactory extension was found. Please ensure that the classpath includes a WireMock extension that provides an HttpServerFactory implementation. See <http://wiremock.org/docs/extending-wiremock/> for more information.
	at com.github.tomakehurst.wiremock.WireMockServer.lambda$getHttpServerFactory$2(WireMockServer.java:95)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at com.github.tomakehurst.wiremock.WireMockServer.getHttpServerFactory(WireMockServer.java:93)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:78)
	at app.WiremockApplication.main(WiremockApplication.java:38)
l
Can you give a little more information about how you are starting wiremock? Are you using standalone, or docker or in test? If standalone or docker, what commands are you using. Also what version of wiremock are you using?
a
I use this java code to start
Copy code
public static void main(String[] args) {
		String wiremockFilesDir = "wiremock/src/main/resources";
		boolean wiremockLogging = true;
		int port = 8080;
		int portSecure = 8079;

		WireMockConfiguration options = new WireMockConfiguration();
		options.port(port);
		options.httpsPort(portSecure);
		options.usingFilesUnderDirectory(wiremockFilesDir);
		options.notifier(new ConsoleNotifier(wiremockLogging));
		options.gzipDisabled(true);
		options.keystorePassword("password");
		options.keystoreType("jks");
//		options.keystorePath("wiremock_recording/localhost.jks");
		options.globalTemplating(true);
		options.notifier();

		WireMockServer wiremockServer = new WireMockServer(options);
		wiremockServer.start();

		System.out.println("Wiremock server: <http://localhost>:" + port);
		System.out.println("Wiremock secure server: " + wiremockServer.baseUrl());
	}
}
// options.keystorePath("wiremock_recording/localhost.jks"); At this line, it creates problem . For now I just commented and moved forward
Can you help me on details or some reference on it please
l
Just so i am clear, you are starting a standalone version of wiremock but you are starting as part of your own code? Have you looked at just starting wiremock in standalone mode or using docker ? • https://wiremock.org/docs/standalone/java-jar/ • https://wiremock.org/docs/standalone/docker/
a
Not using stand alone version. Using below wiremock version
Copy code
implementation "org.wiremock:wiremock-jetty12:3.9.1"
l
To make sure you have all the dependencies included you might need to use the standalone jar - https://mvnrepository.com/artifact/org.wiremock/wiremock-standalone/3.9.1
šŸ‘€ 1