我尝试在Web应用程序中使用jersey-client,但是出现以下异常。 有人可以帮忙吗?
谢谢!
java.lang.NoSuchMethodError: javax/ws/rs/core/MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)V
(loaded from file:/D:/Users/xxxxxxx/.m2/repository/com/ibm/was/srt/j2ee/8.5.5.9/j2ee-8.5.5.9.jar by sun.misc.Launcher$AppClassLoader@bb0a768e)
called from class org.glassfish.jersey.client.ClientRequest
(loaded from file:/D:/Users/ xxxxxxx /.m2/repository/org/glassfish/jersey/core/jersey-client/2.26/jersey-client-2.26.jar by sun.misc.Launcher$AppClassLoader@bb0a768e).
at org.glassfish.jersey.client.ClientRequest.accept(ClientRequest.java:335)
at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:222)
at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:60)
答案 0 :(得分:0)
我在JEE 6中使用了错误的版本,这是正确的版本:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.1</version>
</dependency>