Coder Social home page Coder Social logo

Comments (3)

michaelcowan avatar michaelcowan commented on June 12, 2024

I tried adding the SLF4J dependency directly:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.36</version>
</dependency>

And now get another NoClassDefFoundError exception:

java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/ThreadPool
	at com.github.tomakehurst.wiremock.core.WireMockConfiguration.<init>(WireMockConfiguration.java:107)
	at com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig(WireMockConfiguration.java:161)
	at com.github.tomakehurst.wiremock.core.WireMockConfiguration.options(WireMockConfiguration.java:165)
	at com.github.tomakehurst.wiremock.junit5.WireMockExtension.resolveOptions(WireMockExtension.java:192)
	at com.github.tomakehurst.wiremock.junit5.WireMockExtension.startServerIfRequired(WireMockExtension.java:164)
	at com.github.tomakehurst.wiremock.junit5.WireMockExtension.beforeAll(WireMockExtension.java:231)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	Suppressed: java.lang.NullPointerException: Cannot invoke "com.github.tomakehurst.wiremock.WireMockServer.isRunning()" because "this.wireMockServer" is null
		at com.github.tomakehurst.wiremock.junit5.WireMockExtension.stopServerIfRunning(WireMockExtension.java:219)
		at com.github.tomakehurst.wiremock.junit5.WireMockExtension.afterAll(WireMockExtension.java:257)
		... 1 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.thread.ThreadPool
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 7 more

from wiremock.

michaelcowan avatar michaelcowan commented on June 12, 2024

I suspect that, for me, WireMock isn't pulling in its dependencies.
This can be shown using mvn dependency:tree to diff 3.4.2 and 3.5.1:

--- io.blt:gregbot:jar:1.0-SNAPSHOT
+++ io.blt:gregbot:jar:1.0-SNAPSHOT
@@ -26,54 +26,4 @@
 |  +- net.bytebuddy:byte-buddy-agent:jar:1.14.12:test
 |  \- org.objenesis:objenesis:jar:3.3:test
 +- org.mockito:mockito-junit-jupiter:jar:5.11.0:test
-\- org.wiremock:wiremock:jar:3.4.2:test
-   +- org.eclipse.jetty:jetty-server:jar:11.0.20:test
-   |  +- org.eclipse.jetty:jetty-http:jar:11.0.20:test
-   |  +- org.eclipse.jetty:jetty-io:jar:11.0.20:test
-   |  \- org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:jar:5.0.2:test
-   +- org.eclipse.jetty:jetty-servlet:jar:11.0.20:test
-   |  \- org.eclipse.jetty:jetty-security:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-servlets:jar:11.0.20:test
-   |  \- org.eclipse.jetty:jetty-util:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-webapp:jar:11.0.20:test
-   |  \- org.eclipse.jetty:jetty-xml:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-proxy:jar:11.0.20:test
-   |  \- org.eclipse.jetty:jetty-client:jar:11.0.20:test
-   +- org.eclipse.jetty.http2:http2-server:jar:11.0.20:test
-   |  \- org.eclipse.jetty.http2:http2-common:jar:11.0.20:test
-   |     \- org.eclipse.jetty.http2:http2-hpack:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-alpn-server:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-alpn-java-server:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-alpn-java-client:jar:11.0.20:test
-   +- org.eclipse.jetty:jetty-alpn-client:jar:11.0.20:test
-   +- com.google.guava:guava:jar:33.0.0-jre:test
-   |  +- com.google.guava:failureaccess:jar:1.0.2:test
-   |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:test
-   |  +- org.checkerframework:checker-qual:jar:3.41.0:test
-   |  +- com.google.errorprone:error_prone_annotations:jar:2.23.0:test
-   |  \- com.google.j2objc:j2objc-annotations:jar:2.8:test
-   +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.16.1:test
-   +- org.apache.httpcomponents.client5:httpclient5:jar:5.3.1:test
-   |  \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2.4:test
-   +- org.xmlunit:xmlunit-core:jar:2.9.1:test
-   |  \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
-   |     \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
-   +- org.xmlunit:xmlunit-legacy:jar:2.9.1:test
-   +- org.xmlunit:xmlunit-placeholders:jar:2.9.1:test
-   +- net.javacrumbs.json-unit:json-unit-core:jar:2.38.0:test
-   |  \- org.hamcrest:hamcrest-core:jar:2.2:test
-   |     \- org.hamcrest:hamcrest:jar:2.2:test
-   +- com.jayway.jsonpath:json-path:jar:2.9.0:test
-   |  \- net.minidev:json-smart:jar:2.5.0:test
-   |     \- net.minidev:accessors-smart:jar:2.5.0:test
-   +- org.ow2.asm:asm:jar:9.6:test
-   +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
-   +- com.github.jknack:handlebars:jar:4.3.1:test
-   +- com.github.jknack:handlebars-helpers:jar:4.3.1:test
-   +- commons-fileupload:commons-fileupload:jar:1.5:test
-   +- commons-io:commons-io:jar:2.15.1:test
-   +- com.networknt:json-schema-validator:jar:1.3.3:test
-   |  +- com.ethlo.time:itu:jar:1.8.0:test
-   |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.15.3:test
-   |     \- org.yaml:snakeyaml:jar:2.1:test
-   \- org.slf4j:slf4j-api:jar:1.7.36:test
\ No newline at end of file
+\- org.wiremock:wiremock:jar:3.5.1:test
\ No newline at end of file

from wiremock.

michaelcowan avatar michaelcowan commented on June 12, 2024

Fixed in 3.5.2

from wiremock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.