I am using jersey for my project and tring to parse a URI from a string.
UriBuilder.fromUri("http://localhost:8000").build();
The code is simple, but I get a error below
java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl
It seems the program can not find the delegate. I already imported javax.ws.rs.core.UriBuilder
and have jersey-common 2.0
that should contain the delegate in my build path. But I still get this error.
Does someone know how to fix it? Thanks!
If you're using Maven, use the following dependency:
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.22.2</version>
<scope>test</scope>
</dependency>
For Gradle, the following will work:
testImplementation 'org.glassfish.jersey.core:jersey-common:2.22.2'
Developing against a Wildfly 10.1 runtime I didn't want to introduce Jersey into my builds. With Gradle I used
testRuntime "org.jboss.resteasy:resteasy-jaxrs:$versions.resteasy"
resteasy version is 3.0.19.Final. This jar contains
META-INF/services/javax.ws.rs.ext.RuntimeDelegate
with an entry
org.jboss.resteasy.spi.ResteasyProviderFactory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With