NoSuchFieldError:INCLUDE_ALL(Web服务)

时间:2016-12-01 18:16:12

标签: java rest jersey

我在java中开发了一个Rest Web Service应用程序并部署了WAR文件。启动服务器时,会发生以下错误。

SEVERE: StandardWrapper.Throwable
java.lang.NoSuchFieldError: INCLUDE_ALL
    at org.glassfish.jersey.server.ResourceConfig$State.<init>(ResourceConfig.java:109)
    at org.glassfish.jersey.server.ResourceConfig.<init>(ResourceConfig.java:350)
    at org.glassfish.jersey.servlet.WebComponent.createResourceConfig(WebComponent.java:425)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:290)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

我已将以下jar文件添加到我的项目中。

added jar files

我已经下载了jersey-common jar版本2.24.1。

我无法找到实际问题的位置?请帮忙。

1 个答案:

答案 0 :(得分:19)

您的jersey-server.jar 2.1将其更改为2.24.1 所有Jersey依赖项都应该是相同的版本。