users@jersey.java.net

Re: [Jersey] Annotation Inheritance

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 30 Oct 2009 10:50:45 -0400

Move the @Path from the interface to the implementation class.
Annotation inheritance only applies to method-level annotations not
class-level ones.

Marc.

On Oct 30, 2009, at 10:38 AM, animesh sonkar wrote:

> hi Tried adding the packages and separating it with ;
> I am still getting the same exception on startup.
> My sample is as follows:
> @Path("/test")
> public interface TestInterface {
>
> @GET
> @Produces("text/plain")
> public String sayHello();
> }
>
> public class TestIMPL implements TestInterface {
>
> public String sayHello() {
> // TODO Auto-generated method stub
> return "Hello World";
> }
>
> }
>
> <display-name>JerseyTestWebApp</display-name>
> <servlet>
> <servlet-name>PESJerseyServletContainer</servlet-name>
> <servlet-
> class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-
> class>
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</
> param-name>
> <param-
> value>pack.one.jersey.impl;pack.one.jersey.interfaces</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>PESJerseyServletContainer</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> Any pointers....
>
> Keep up with people you care about with Yahoo! India Mail. Learn how.