users@jersey.java.net

Re: [Jersey] Missing dependency - com.sun.ws.rs.ext.RuntimeDelegateImpl

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 05 Nov 2008 14:23:54 +0100

Hi James,

It is an annoying bug. Contrary to what is documented you need to
additionally include jersey-server in the class path.

It is fixed in 1.0.1-SNAPSHOT.

Paul.

On Nov 5, 2008, at 2:10 PM, James Abley wrote:

> Hi,
>
> I'm trying to use the UriBuilder implementation, and am just writing
> some learning tests to explore the API. I'm using Jersey 1.0, with the
> jsr311-api, jersey-client and jersey-core jars.
>
> public class UriTemplateTest {
>
> @Test
> public void simpleUriTemplate() throws Exception {
> UriBuilder builder =
> UriBuilder.fromPath("{baseUri}/{articleDirPath}/{datePart}/
> {uniqueNodeName}");
> Map<String, String> values = new HashMap<String, String>();
>
> values.put("baseUri", "/home/xml/feeds");
> values.put("articleDirPath", "news/local");
> values.put("datePart", "2008/11/04");
> values.put("uniqueNodeName", "123456.ece");
>
> assertEquals("/home/xml/feeds/news/local/
> 2008/11/04/123456.ece",
> builder.buildFromMap(values).getPath());
> }
> }
>
> This is failing with
>
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> com.sun.ws.rs.ext.RuntimeDelegateImpl
> at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:
> 112)
> at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
> at javax.ws.rs.core.UriBuilder.fromPath(UriBuilder.java:111)
> at com.example.UriTemplateTest.getUriBuilder(UriTemplateTest.java:35)
> at
> com
> .example.UriTemplateTest.simpleNotwUriTemplate(UriTemplateTest.java:
> 23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun
> .reflect
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun
> .reflect
> .DelegatingMethodAccessorImpl
> .invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.runners.model.FrameworkMethod
> $1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org
> .junit
> .internal
> .runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org
> .junit
> .runners
> .model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org
> .junit
> .internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:
> 20)
> at
> org
> .junit
> .internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at
> org
> .junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
> 31)
> at
> org
> .junit
> .runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
> 73)
> at
> org
> .junit
> .runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
> 46)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
> at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
> at
> org
> .junit
> .internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at
> org
> .junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
> 31)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
> at
> org
> .eclipse
> .jdt
> .internal
> .junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
> at
> org
> .eclipse
> .jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org
> .eclipse
> .jdt
> .internal
> .junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
> org
> .eclipse
> .jdt
> .internal
> .junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
> org
> .eclipse
> .jdt
> .internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
> org
> .eclipse
> .jdt
> .internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
> 196)
> Caused by: java.lang.ClassNotFoundException:
> com.sun.ws.rs.ext.RuntimeDelegateImpl
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:44)
> at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:141)
> at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:
> 95)
> ... 28 more
>
> I think I'm just missing a jar, but Google doesn't seem to know much
> about the class com.sun.ws.rs.ext.RuntimeDelegateImpl
>
> Can anyone point me in the right direction please?
>
> Cheers,
>
> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>