users@jersey.java.net

Re: [Jersey] UriInfo mishandling port numbers

From: Craig McClanahan <Craig.McClanahan_at_Sun.COM>
Date: Mon, 17 Nov 2008 11:20:43 -0800

Gili wrote:
> According to Netbeans, I am using Jersey 1.0 -- but remember
> http://www.netbeans.org/issues/show_bug.cgi?id=122930
>
> I will download 1.0 myself off your website and try reproducing the problem
> just to be sure.
>
Just as a "voice of experience" warning ... with NB 6.1, if you tell NB
that you're using the original (Jersey 0.8) stuff, and then later try to
manually use Jersey 1.0 through library references, *sometimes* NB will
mysteriously add the 0.8 jar files back into your library dependencies,
which leads to all kinds of chaos when both 0.8 and 1.0 libraries are
loaded.

My solution to this was to rebuild my application's project structure
*without* telling NB this is a Jersey application, and then added the
1.0 libraries separately. You give up the code generators doing it this
way, but by now I've got enough real resource classes that I just
cut-n-paste one of those when I need to start a new one.

I don't know whether the 6.5 release candidates do the same sort of
thing, as the internal projects I'm involved with are all based on 6.1
at the moment.
> Gili
>
Craig

>
> Paul Sandoz wrote:
>
>> On Nov 17, 2008, at 8:50 AM, Gili wrote:
>>
>>
>>> Hi,
>>>
>>> There seems to be a bug in the implementation of UriInfo.path(Class
>>> resource, String method). Here is the output I see:
>>>
>>> URI baseUri = URI.create("http://example.com/v1/")
>>>
>>> UriBuilder.fromUri(baseUri).path(AdministratorsResource.class).build()
>>> returns "http://example.com/v1/administrators"
>>>
>>> UriBuilder
>>> .fromUri
>>> (baseUri
>>> ).path
>>> (AdministratorsResource.class).path(AdministratorsResource.class,
>>> "locateAdministrator").build(username) returns
>>> "http://example.com:-1/v1/administrators/username"
>>>
>>> Notice how port ":-1" was added. I am expecting Jersey to retain the
>>> default
>>> port. Should I file a bug report for this?
>>>
>>>
>> What version of Jersey are you using? It should be fixed in 1.0.
>>
>> https://jersey.dev.java.net/issues/show_bug.cgi?id=114
>>
>> I re-verified in 1.0.1-SNAPSHOT.
>>
>> Paul.
>>
>>
>>> Gili
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/UriInfo-mishandling-port-numbers-tp1508438p1508438.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
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>>
>>
>
>