【问题标题】:java.lang.NoSuchMethodError: com.sun.jersey.core.spi.factory.MessageBodyFactory.<init>(Lcom/sun/jersey/core/spi/component/ProviderServices;)Vjava.lang.NoSuchMethodError: com.sun.jersey.core.spi.factory.MessageBodyFactory.<init>(Lcom/sun/jersey/core/spi/component/ProviderServices;)V
【发布时间】:2017-01-15 14:44:51
【问题描述】:

我正在尝试将一个 Maven 构建 Java 项目部署到 JBoss 服务器 Web 项目。我能够到达所需的服务器。但是,我无法从服务器获得预期的回复。错误出现为:

java.lang.NoSuchMethodError: com.sun.jersey.core.spi.factory.MessageBodyFactory.<init>(Lcom/sun/jersey/core/spi/component/ProviderServices;)V
    at com.sun.jersey.api.client.Client.<init>(Client.java:230)
    at com.sun.jersey.api.client.Client.<init>(Client.java:158)
    at com.sun.jersey.api.client.Client.create(Client.java:573)

我有 jerser-core 1.2、jersey-bundle 1.2、jersey-server 1.2、jersey-client 1.2、jersey servlet 1.17 和 jersey

at com.sun.jersey.api.client.Client.<init>(Client.java:230)
    at com.sun.jersey.api.client.Client.<init>(Client.java:158)
    at com.sun.jersey.api.client.Client.create(Client.java:573)

1.17 在我的 lib 文件夹中。

【问题讨论】:

  • 错误信息清楚地表明类加载器中加载了旧版本的 jerser-core 1.2 jar。
  • 尝试对所有 jersey 依赖 jar 使用通用版本

标签: java web-services maven jboss jersey


【解决方案1】:

我的猜测是您的类路径中的 tha jar 有问题。可能,您的类路径或 WEB-INF/lib 中可能有两个不同版本的球衣

【讨论】:

    猜你喜欢
    • 2013-09-21
    • 2019-05-04
    • 1970-01-01
    • 2019-10-17
    • 2011-01-26
    • 2013-06-27
    • 2019-12-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多