org.glassfish.jersey.internal.RuntimeDelegateImpl NOT FOUND

Spark8006 picture Spark8006 · Oct 18, 2013 · Viewed 49.4k times · Source

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!

Answer

Archimedes Trajano picture Archimedes Trajano · Nov 28, 2013

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:

testCompile 'org.glassfish.jersey.core:jersey-common:2.22.2'