java NoSuchFieldError:INCLUDE_ALL(Web 服务)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40917670/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NoSuchFieldError: INCLUDE_ALL (Web Service)
提问by Sriram
I have developed one Rest Web Service application in java and deployed the WAR file. While starting the server, the following error occurs.
我已经用 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)
I have added following jar files to my project.
我已将以下 jar 文件添加到我的项目中。
I have downloaded jersey-common jar version 2.24.1.
我已经下载了 jersey-common jar 版本 2.24.1。
I am not able to find where the actual issue is? Please help.
我找不到实际问题在哪里?请帮忙。
回答by Bandi Kishore
Your jersey-server.jar is 2.1
change it to 2.24.1
.
All Jersey dependencies should be in the same version.
您的 jersey-server.jar2.1
将其更改为2.24.1
.
所有 Jersey 依赖项都应该在同一版本中。