users@jersey.java.net

Re: [Jersey] Method is not recognized as valid Java method annotated with @HttpMethod

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 21 Apr 2009 16:22:21 +0200

On Apr 21, 2009, at 4:13 PM, Farrukh Najmi wrote:

>
> Oops! My bad I forgot to do that...
>
> @Path("/updateRepositoryItem")
> @POST
> @Consumes("multipart/form-data")
> @Produces({"application/xml","application/json"})
> public Response updateRepositoryItem(
> @FormDataParam("format") String format,
> @FormDataParam("id") String id,
> @FormDataParam("repositoryItem") InputStream repositoryItem,
> @FormDataParam("contentType") String contentType
> );
>

Have you included a dependency on the jersey-multipart module?

Paul.

>
>
> Paul Sandoz wrote:
>>
>>
>> Can you send the method of your resource class with all the
>> annotations?
>>
>> Paul.
>>
>>
>>> [ERROR]INFO: Scanning for root resource and provider classes in
>>> the packages:
>>> [ERROR] com.test.server
>>> [ERROR]Apr 21, 2009 8:20:43 AM
>>> com.sun.jersey.api.core.PackagesResourceConfig init
>>> [ERROR]INFO: Root resource classes found:
>>> [ERROR] class com.test.server.UIServerRestInterface
>>> [ERROR]Apr 21, 2009 8:20:43 AM
>>> com.sun.jersey.api.core.PackagesResourceConfig init
>>> [ERROR]INFO: Provider classes found:
>>> [ERROR] class com.test.server.JAXBContextResolver
>>> [ERROR]Apr 21, 2009 8:20:43 AM
>>> com.sun.jersey.spi.spring.container.SpringComponentProviderFactory
>>> register
>>> [ERROR]INFO: Registering Spring bean, UIServerRestInterface, of
>>> type com.test.server.UIServerRestInterface as a root resource class
>>> [ERROR]Apr 21, 2009 8:20:44 AM
>>> com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate
>>> [ERROR]SEVERE: Exception occurred when intialization
>>> [ERROR]com.sun.jersey.api.container.ContainerException: Method,
>>> public javax.ws.rs.core.Response
>>> com
>>> .test
>>> .server
>>> .UIServerRestInterface
>>> .updateRepositoryItem
>>> (java
>>> .lang
>>> .String,java.lang.String,java.io.InputStream,java.lang.String),
>>> annotated with POST of resource, class
>>> com.test.server.UIServerRestInterface, is not recognized as valid
>>> Java method annotated with @HttpMethod.
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .model.method.ResourceHttpMethod.<init>(ResourceHttpMethod.java:92)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .model.method.ResourceHttpMethod.<init>(ResourceHttpMethod.java:69)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .model.ResourceClass.processSubResourceMethods(ResourceClass.java:
>>> 258)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey.server.impl.model.ResourceClass.<init>(ResourceClass.java:
>>> 128)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl.newResourceClass(WebApplicationImpl.java:348)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl.getResourceClass(WebApplicationImpl.java:321)
>>> [ERROR] at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl.processRootResources(WebApplicationImpl.java:
>>> 807)
>>>
>>> --
>>> Regards,
>>> Farrukh
>>>
>>> Web: http://www.wellfleetsoftware.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
>>
>
>
> --
> Regards,
> Farrukh
>
> Web: http://www.wellfleetsoftware.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>