users@jersey.java.net

[Jersey] Re: Unable to get simple JAXB to work

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Thu, 07 Apr 2011 19:18:22 +0200

Hi Sean,

the info message only tells you no provider was found within
your application. I.e. you should not bother with that informational
message, as long as you do not get any stack trace/error message.

What does curl return, if you call it with the -i option?

How did you check, the request did not make it to the resource?

~Jakub

On 04/07/2011 06:39 PM, sean.landis_at_gmail.com wrote:
> HI,
> I am trying to get JAXB to work with a simple resource:
>
> ...
> @PUT @Path("{user}")
> @Consumes(MediaType.APPLICATION_XML)
> public void createWeblog(@PathParam("user") String user, User
> userData) {
> Bordello.get(WeblogsService.class).createWeblog(user, userData);
> }
>
> I am using Grizzly container. My curl command is:
> curl --header "Content-Type: application/xml" --upload-file
> newuser.jaxb http://localhost:9998/weblogs/joe
>
> and newuser.jaxb is:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <User>
> <name>
> Joe Blow
> </name>
> </User>
>
> The JAXB entity is:
>
> @XmlRootElement
> public class User {
> private String name;
>
> public User() {}
> public User(String name) { setName(name); }
> public String getName() { return name; }
> public void setName(String name) { this.name = name; }
> }
>
> When I send the PUT request to the server I get the following:
>
> Apr 7, 2011 10:26:27 AM com.sun.jersey.api.core.PackagesResourceConfig
> init
> INFO: Scanning for root resource and provider classes in the packages:
> com.overstock.rest
> com.overstock.model
> Apr 7, 2011 10:26:27 AM com.sun.jersey.api.core.ScanningResourceConfig
> logClasses
> INFO: Root resource classes found:
> class com.overstock.rest.MyResource
> class com.overstock.rest.WeblogsResource
> Apr 7, 2011 10:26:27 AM com.sun.jersey.api.core.ScanningResourceConfig
> init
> INFO: No provider classes found.
> Apr 7, 2011 10:26:27 AM
> com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.6 03/25/2011
> 01:14 PM'
>
>
> I don't know how to configure the provider. Please help!
>