It seems that you need to implement the required MessageBodyWriter for the classes which your transport through Jersey.
You can attach @Provider to class A, and make it implements MessageBodyWriter such as:
@Provider
public class A implements MessageBodyWriter
This will force you to override the required methods(writeTo, getSize, isWriteable) while jersey is tranporting the objects in your methods.