Hi,
Jersey uses JDK logging, so you need to enable it as specified by JDK
logging.
The error:
> SEVERE: A message body reader for Java type, class
> gov.hhs.acf.util.ws.grants.model.GrantsDTO, and MIME media type,
> application/xml, was not found
Is not related to the @GET method you presented in your previously
email but related to parsing XML into an instance of GrantsDTO. Do you
have a @PUT or@ POST annotated Java method?
That error indicates that Jersey cannot find an appropriate plugin in
read the XML document into an instance of GrantsDTO. Given what you
previously sent the GrantsDTO class is correctly annotated with
@XmlRootElement thus i suspect that either:
1) the proxying is not preserving annotations; or
2) or there is another error, perhaps reflected in the server logs,
about JAXB jar conflicts?
If you could distill things down into a reproducible test case it
would be easier for me to investigate.
Paul.
On Mar 5, 2010, at 11:39 PM, fachhoch wrote:
>
> I did a simple change added a public constructor to resource
>
> here is the modified code
>
>
> package gov.hhs.acf.util.ws.grants.service;
>
> import gov.hhs.acf.util.ws.grants.model.GrantsDTO;
>
> import javax.ws.rs.GET;
> import javax.ws.rs.Path;
> import javax.ws.rs.ProduceMime;
> import javax.ws.rs.core.MediaType;
>
> @Path("/grants")
> public class GrantsResource {
>
>
> public GrantsResource() {
> }
>
> @GET
> @ProduceMime(MediaType.APPLICATION_XML)
> public GrantsDTO getGrantsDTO(){
> GrantsDTO grantsDTO= new GrantsDTO();
> grantsDTO.setGranteeName("grantee name");
> grantsDTO.setGrantNumber("grantNumber");
> return grantsDTO;
> }
> }
> and I get this
>
>
> SEVERE: A message body reader for Java type, class
> gov.hhs.acf.util.ws.grants.model.GrantsDTO, and MIME media type,
> application/xml, was not found
>
> also please tell me how to turn logging on for jersy
>
> I added this my log4j.xml
>
> <logger name="com.sun.jersy">
> <level value="debug"/>
> </logger>
>
>
> its not writing any thing to log , please tell me what am I missing ?
>
>
>
> --
> View this message in context: http://n2.nabble.com/Error-marshalling-out-JAXB-object-of-type-class-gov-hhs-acf-util-ws-grants-model-GrantsDTO-tp4683828p4683896.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>