Jersey Library错误(NoSuchMethod然后IncompatibleClassChangeError)

时间:2014-06-16 15:04:21

标签: maven jersey weblogic java

我们刚刚从Weblogic 10升级到Weblogic 12并开始出现此错误

<Error> <com.sun.jersey.spi.container.ContainerResponse> <hostname> <nodename> <[ACTIVE] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'> <ws_user> <> <> <140123234234> <BEA-000000> <The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: com.sun.jersey.client.apache.ApacheHttpClientHandler.getRequestEntityWriter(Lcom/sun/jersey/api/client/ClientRequest;)Lcom/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter

经过一番挖掘,我意识到Jersey文库(com.sun.jersey.contribs)需要从1.18.1升级到1.2版本。我做了那个改变,然后开始出现以下错误

weblogic.application.ModuleException: java.lang.IncompatibleClassChangeError: com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider and com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl disagree on InnerClasses attribute

稍微挖掘一下,我了解到我的JSR311-api(javax.ws.rs)必须是1.1.1,而且已经是这样了。现在我迷失了我还有什么要改变以修复这些错误

1 个答案:

答案 0 :(得分:2)

更新Jersey库时我遇到了类似的问题。最后,事实证明旧jar仍然在/ lib文件夹中。确保您已完全删除以前的版本。

希望有所帮助。