users@jersey.java.net

[Jersey] Re: _at_ApplicationPath not working

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Mon, 17 Jan 2011 12:02:06 +0100

On Jan 15, 2011, at 4:11 AM, Gili wrote:

>
>
> False alarm. This works fine under Glassfish 3.0.1. This is likely
> another
> bug in Glassfish 3.1-b37
>

More details?

Paul.

> Thanks,
> Gili
>
>
> Paul Sandoz-2 wrote:
>>
>>
>> On Jan 14, 2011, at 5:18 AM, Gili wrote:
>>
>>>
>>> Hi,
>>>
>>> I am trying to deploy a JAX-RS application using Netbeans 7.0 (dev
>>> build),
>>> Glassfish 3.1.1 and Jersey 1.4.
>>>
>>
>> 3.1.1? do you mean 3.1?
>>
>>
>>> If I add the following web.xml file to my project everything works
>>> fine:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <web-app xmlns="http://java.sun.com/xml/ns/javaee"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
>>> version="3.0">
>>> <servlet>
>>> <servlet-name>foo.ApplicationConfig</servlet-name>
>>> <load-on-startup>1</load-on-startup>
>>> </servlet>
>>> <servlet-mapping>
>>> <servlet-name>foo.ApplicationConfig</servlet-name>
>>> <url-pattern>/*</url-pattern>
>>> </servlet-mapping>
>>> <session-config>
>>> <session-timeout>
>>> 30
>>> </session-timeout>
>>> </session-config>
>>> </web-app>
>>>
>>> If, however, I remove web.xml and define the following class then my
>>> resource doesn't get loaded:
>>>
>>> @ApplicationPath("/*")
>>> public class ApplicationConfig extends DefaultResourceConfig
>>> {
>>> @Override
>>> public Set<Class<?>> getClasses()
>>> {
>>> return Sets.<Class<?>>newHashSet(DoctorsResource.class);
>>> }
>>> }
>>>
>>> What am I doing wrong?
>>>
>>
>> Not sure, from what say all looks correct, can send a zip of a maven
>> project or NB project that reproduces the issue?
>>
>> Paul.
>>
>>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/ApplicationPath-not-working-tp5920648p5924027.html
> Sent from the Jersey mailing list archive at Nabble.com.