A message body writer for Java type, class myPackage.B, and MIME media type, application/octet-stream, was not found

后端 未结 10 1445

I am new at RESTful webservices and was trying to update my @OneToMany relationship from a standalone client application, but I am not able to do that. I am usi

10条回答
  •  野性不改
    2020-11-29 07:02

    Adding reference to:

    
        com.sun.jersey
        jersey-json
        ${jersey1.version}
    
    

    As long as adding clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true); on client creation solved the issue for me:

    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true);
    Client client = Client.create(clientConfig);
    

提交回复
热议问题