Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.glassfish.jersey.internal.RuntimeDelegateImpl NOT FOUND

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!

like image 310
Spark8006 Avatar asked Oct 18 '13 15:10

Spark8006


2 Answers

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'
like image 89
Archimedes Trajano Avatar answered Oct 26 '22 22:10

Archimedes Trajano


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
like image 9
Thomas Newman Avatar answered Oct 26 '22 22:10

Thomas Newman