我正在为我的项目使用jersey,并尝试从字符串中解析URI。
UriBuilder.fromUri("http://localhost:8000").build();
代码很简单,但我得到了下面的错误
java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl
似乎程序找不到代理。我已经导入了javax.ws.rs.core.UriBuilder
,并且在构建路径中具有应该包含委托的jersey-common 2.0
。但是我仍然得到这个错误。
有人知道怎么修吗?谢谢!
发布于 2013-11-28 13:34:09
如果您使用的是Maven,请使用以下依赖项:
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.22.2</version>
<scope>test</scope>
</dependency>
对于Gradle,以下方法将起作用:
testCompile 'org.glassfish.jersey.core:jersey-common:2.22.2'
发布于 2016-12-02 09:11:35
针对Wildfly 10.1运行时进行开发,我不想在我的构建中引入Jersey。使用Gradle时,我使用
testRuntime "org.jboss.resteasy:resteasy-jaxrs:$versions.resteasy"
resteasy版本是3.0.19.Final。此jar包含
META-INF/services/javax.ws.rs.ext.RuntimeDelegate
带有一个条目
org.jboss.resteasy.spi.ResteasyProviderFactory
发布于 2017-09-19 06:50:35
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.26</version>
<scope>test</scope>
</dependency>
我在使用Java8和jersey时遇到了问题--通用的2.22.2,但2.26起作用了。
https://stackoverflow.com/questions/19452887
复制相似问题