ZK with Jersey

asked 2018-02-09 19:08:14 +0800

sustav86 gravatar image sustav86

My ZK project doesn't see Jersey MessageBodyWriter when I do request to the server.

Client client = ClientBuilder.newClient();

WebTarget baseTarget = client.target("target");

Response postResponse = baseTarget.request().post(Entity.text(transaction));

add to web.xml:

    <servlet-name>Jersey Web Application</servlet-name>
        <param-value>ua.sustavov.payment.service, org.codehaus.jackson.jaxrs</param-value>
    <servlet-name>Jersey Web Application</servlet-name>


public class TransactionMessageBodyWriter implements MessageBodyWriter<Transaction> {

    public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) {
        return Transaction.class.isAssignableFrom(aClass);

    public void writeTo(Transaction transaction, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> multivaluedMap, OutputStream outputStream) throws IOException, WebApplicationException {


    public long getSize(Transaction transaction, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        return -1;

When I whant to send request? my App doesn't see MessageBodyWriter Thanks!

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2018-02-09 19:08:14 +0800

Seen: 8 times

Last updated: Feb 09 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More