java Jersey 客户端依赖项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10261676/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 00:17:06  来源:igfitidea点击:

Jersey client dependencies

javaclasspathjersey

提问by user12384512

According to documentation, all I need for Jersey client is jersey-bundle.jar. But simple code, that build request and sent it throws exception.

根据文档,Jersey 客户端所需的只是jersey-bundle.jar. 但是简单的代码,构建请求并发送它抛出异常。

java.lang.ClassNotFoundException: javax.ws.rs.ext.Providers

After adding jsr311-api-1.0.jarto classpath. I've got another exception.

添加jsr311-api-1.0.jar到类路径后。我还有一个例外。

java.lang.NoClassDefFoundError: javax/ws/rs/core/Response$StatusType

Where I can find full dependencies list for Jersey. What jars should be included. Btw I can't user Maven, Ivy, etc.

在哪里可以找到 Jersey 的完整依赖项列表。应该包括哪些罐子。顺便说一句,我不能使用 Maven、Ivy 等。

Thanks

谢谢

采纳答案by verhage

Try searching mvnrepository.com

尝试搜索 mvnrepository.com

Lookup the package you are looking for, select a version and it shows you everything the artifact depends on.

查找您正在寻找的包,选择一个版本,它会显示工件所依赖的一切。

For jersey-bundle: http://mvnrepository.com/artifact/com.sun.jersey/jersey-bundle/1.13-b01

对于球衣捆绑:http: //mvnrepository.com/artifact/com.sun.jersey/jersey-bundle/1.13-b01

回答by rogerdpack

For me this meant "you're using jersey-client 1.19 but then manually calling out jsr311-api-1.0" (apparently that jersey client version [1.19] actually needs/wanted jsr311-api-1.1 instead).

对我来说,这意味着“您正在使用 jersey-client 1.19,然后手动调用 jsr311-api-1.0”(显然 jersey 客户端版本 [1.19] 实际上需要/想要 jsr311-api-1.1)。

回答by Avinash Pande

Better way is to add bundlefor Jersey client from MavenLinkselect jar/pom from files row instead of adding independent/separate jar files. if you do so by adding individual jar you will get another/different error. Better way is to add bundle (group of dependent jar for Jersy client).

更好的方法是从MavenLink为 Jersey 客户端添加,从文件行选择 jar/pom,而不是添加独立/单独的 jar 文件。如果您通过添加单个 jar 来这样做,您将收到另一个/不同的错误。更好的方法是添加包(Jersy 客户端的依赖 jar 组)。