简体   繁体   English

WebTarget 类型中的方法 request(String...) 不适用于参数 (MediaType)

[英]The method request(String...) in the type WebTarget is not applicable for the arguments (MediaType)

I'm doing Jersey client and getting this error on a line我正在做 Jersey 客户端并在线上收到此错误

String response = target.path("activities/" + id).request(MediaType.APPLICATION_JSON).get(String.class);

Java - 1.8.0.73 / Jersey - 2.22.2 Java - 1.8.0.73 / 泽西岛 - 2.22.2

According to docs - it should work, eclipse shows 3 overloads, but still: The method request(String...) in the type WebTarget is not applicable for the arguments (MediaType)根据文档 - 它应该可以工作,eclipse 显示 3 个重载,但仍然: WebTarget 类型中的方法 request(String...) 不适用于参数 (MediaType)

Why it doesn't see other overloads and throws an exception?为什么它看不到其他重载并抛出异常?

导入了错误的 MediaType - org.eclipse.persistence.oxm.MediaType 而不是 javax.ws.rs.core.MediaType

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 泽西岛-类型WebResource的方法accept(MediaType [])不适用于参数(String) - Jersey - The method accept(MediaType[]) in the type WebResource is not applicable for the arguments (String) 类型“ x”的方法search()不适用于参数(字符串) - The method search() in the type “x” is not applicable for the arguments (String) 类型“x”中的方法 getBytes() 不适用于 arguments(字符串) - The method getBytes() in the type "x" is not applicable for the arguments (String) 部分类型中的方法setText(String)不适用于参数 - method setText(String) in the type Part is not applicable for the arguments 类型为nammi的方法epli(String [])不适用于arguments() - The method epli(String[]) in the type nammi is not applicable for the arguments () 类型中的方法不适用于参数 - Method in the type is not applicable to the arguments 类型中的方法不适用于参数 - The method in the type is not applicable for the arguments 类型中的方法不适用于参数 - the method in type not applicable for the arguments 类型中的方法不适用于参数 - The method in the type is not applicable for the arguments ArrayList类型中的方法add(String) <String> 不适用于参数(对象) - The method add(String) in the type ArrayList<String> is not applicable for the arguments (Object)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM