users@jersey.java.net

ClientHandlerException

From: Christopher Schmidt <Christopher.Schmidt_at_eads.com>
Date: Thu, 09 Jul 2009 09:40:14 +0200

Hello, sometimes when I access the following resource method (TargetEnh is a
subclassed JAXB object):

@GET @Produces("application/xml") @Path("target/object/{tId}/")
@RequiresMorphSession public Target getTarget(@PathParam("tId") String
tId) { ... return new TargetEnh(oi, getUser()); }

With the following client code:

return getTargetResource().path("target/object/" +
targetId).header("Authorization", user.userCredentials()).accept(
MediaType.APPLICATION_XML).get(Target.class);

I get sometimes the following exception.

115131 * In-bound request received
115131 > GET
http://as2-srv-ts:8080/OspWS/V1/Target/target/object/953111100000169
115131 > authorization: Basic b3NyOmNvcw==
115131 > connection: keep-alive
115131 > cache-control: no-cache
115131 > host: as2-srv-ts:8080
115131 > user-agent: Java/1.6.0_07
115131 > pragma: no-cache
115131 > accept: application/xml
115131 >
ERROR [Thread-156] .eads.web.rrs.DataManager Unable to update Track
com.eads.ospws.client.service.OspWSServiceException: Failure to process the
HTTP request or HTTP response
    in Class: com.eads.ospws.client.service.BorderEventClientService
    in Method: getTarget
    at
com.eads.ospws.client.service.BorderEventClientService.getTarget_aroundBody1
9$advice(BorderEventClientService.java:25)
    at
com.eads.ospws.client.service.BorderEventClientService.getTarget(BorderEvent
ClientService.java:1)
    at
com.eads.web.rrs.WebObjectFactory.updateLocation(WebObjectFactory.java:84)
    at com.eads.web.rrs.DataManager.updateTrack(DataManager.java:865)
    at com.eads.web.rrs.DataManager.fireNotification(DataManager.java:784)
    at
com.eads.web.rrs.notification.NotificationQueue.run(NotificationQueue.java:7
4)
Caused by: com.sun.jersey.api.client.ClientHandlerException: A message body
reader for Java type, class com.eads.ospws.resource.jaxb.Target, and MIME
media type, application/octet-stream, was not found
    at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:255)
    at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:220)
    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:561)
    at com.sun.jersey.api.client.WebResource.access$300(WebResource.java:69)
    at
com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:451)
    at
com.eads.ospws.client.service.BorderEventClientService.getTarget_aroundBody1
8(BorderEventClientService.java:194)
    at
com.eads.ospws.client.service.BorderEventClientService.getTarget_aroundBody1
9$advice(BorderEventClientService.java:23)
    ... 5 more


It seams to me that the response header does not contain a ³content-type²
field.
This only happens about 3-10 times per day calling this GET method about 2
times per second.

(using Tomcat 6, Jersey 1.0.3 on a linux 64bit system)

Any suggestions?

Best regards