users@jersey.java.net

Re: [Jersey] Problems debugging UriBuilder

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 01 Dec 2008 20:01:51 +0100

On Dec 1, 2008, at 7:03 PM, Gili wrote:

>
>
> You should be using Netbeans 6.5 where execution stops on a
> breakpoint (not
> you pressing "pause"). This will cause only one thread to suspend
> while
> others continue executing. I then added this to the watch Window:
> "UriBuilder.fromUri(baseUri).path(SomeResource.class)" and the NPE was
> thrown by that expression.
>

It works fine for me when using the HelloWorld sample and breaking on
the client and server.

Are you using Jersey 1.0? there was a bug in the client API when the
server-side jars were *not* present that caused this exception.

Paul.

> Gili
>
>
> Paul Sandoz wrote:
>>
>>
>> On Nov 29, 2008, at 3:02 AM, Gili wrote:
>>
>>>
>>> Hi,
>>>
>>> When I add a UriBuilder to the Netbeans watch window I get the
>>> following
>>> exception:
>>>
>>> java.lang.NullPointerException:
>>> at
>>> javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:
>>> 87)
>>> at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
>>> at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
>>> [snip]
>>>
>>> My guess is that the Netbeans debugger thread is not the same as the
>>> webapp
>>> thread and this causes the implementation to fail. Couldn't the code
>>> be more
>>> robust in this case?
>>>
>>
>> I just tried a quick experiment with 1.0.1 adding a UriBuilder
>> instance to the watch and it worked fine.
>>
>> Can you describe a bit more your setup?
>>
>> Paul.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>>
>
> --
> View this message in context: http://n2.nabble.com/Problems-debugging-UriBuilder-tp1591176p1599830.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>