[Jersey] A message body writer for Java class java.util.Vector not found

From: sreeram duvur <>
Date: Mon, 12 Aug 2013 00:46:35 -0700

I am on GlassFish 3.1.1 and recently started running into this really
vexing problem lately..

Tried to use ArrayList instead of Vector and that has same issue. This is
what I see in log:

exception to response: 500 (Internal Server Error) com.sun.jersey.api.MessageException: A
message body writer for Java class java.util.Vector, and Java type class
java.util.Vector, and MIME media type application/xml was not found

The failing method is as follows:

    @Produces({"application/xml", "application/json"})
    public Response findOpenOrdersSince(@Context SecurityContext context,
            @PathParam("id") Long id,
            @QueryParam("since") Long since) {
            Vector<OrderDetail> result =
getJpaController().findOpenOrdersSince(id, since);
            return Response.ok(result).build();