users@jersey.java.net

[Jersey] Re: _at_ApplicationPath not working

From: Gili <gili.tzabari_at_gmail.com>
Date: Fri, 14 Jan 2011 19:11:44 -0800 (PST)

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

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.