users@jersey.java.net

Exception in Jersey

From: nakoned <nakoned_at_yahoo.com>
Date: Tue, 4 May 2010 13:36:07 -0700 (PDT)

Hi,
  I am having an issue deploying very simple Jersey app. I get the following
exception:
A HTTP GET method, public java.lang.String
jersey.test.JerseyTestApp.test(java.io.InputStream), should not consume any
entity

I browsed through the forum and noticed that I need to set a provider. So I
set the following in my web.xml:

    <servlet>
        <servlet-name>Jersey REST Service</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>jersey.test.JerseyTestApp</param-value>
        </init-param>
    </servlet>

where jersey.test.JerseyTestApp is the name of my class annotated with
@Provider

When I do it however I get the following:
SEVERE: The ResourceConfig instance does not contain any root resource
classes.

I am confused what should <init-param> cointain so that I do not get an
error. Here is my simple class just in case:
@Path("test")
@Provider
public class JerseyTestApp {
 
    @GET
    @Produces("text/plain")
    public String test(InputStream data) {
        String username = "Bla";
        return username;
    }
}

Thanks,
Ed


-- 
View this message in context: http://jersey.576304.n2.nabble.com/Exception-in-Jersey-tp5005509p5005509.html
Sent from the Jersey mailing list archive at Nabble.com.