hummingbird0
Uper2019
2020-10-10 18:09

com.sun.jersey.api.client.ClientHandlerException jar运行报错

求助

代码:

 ClientConfig cc = new DefaultClientConfig();
        cc.getClasses().add(String.class);
        Client client = Client.create(cc);
        WebResource resource = client.resource(filePath);

        LOGGER.info("response status: {}",resource.get(ClientResponse.class).getStatus());

        LOGGER.info("upload Table fileName: [{}] to httpd [{}]",fileName,filePath);
        resource.path(fileName).type(MediaType.TEXT_PLAIN).put(String.class,file);

报错

com.sun.jersey.api.client.ClientHandlerException: A message body writer for Java type, class [B, and MIME media type, text/plain, was not found

在idea环境下运行正常,但使用打jar包后,jar **.jar main报上面的错误

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答