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.