我在pom.xml文件中复制了以下依赖项。但是,我似乎没有使用RX Jersry客户端所需的所有依赖项,因为当我进行以下调用时,我收到一个运行时异常,抱怨找不到类定义。
final Client client = ClientBuilder.newClient();
例外:
java.lang.RuntimeException: java.lang.ClassNotFoundException: Provider org.glassfish.jersey.client.JerseyClientBuilder could not be instantiated: java.lang.reflect.InvocationTargetException
pom.xml
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>jersey-rx-client-rxjava2</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.rx</groupId>
<artifactId>jersey-rx-client-java8</artifactId>
<version>2.24.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-api</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.bundles.repackaged</groupId>
<artifactId>jersey-guava</artifactId>
<version>2.7</version>
</dependency>