openstack4j 中的 RestEasyProviderFactory ClassCastException

问题描述 投票:0回答:1

我已将 openstack4j 版本升级到 3.0.3(从 v2),并且在使用 OKHTTP 连接器和 HTTPCLIENT 连接器从 Tomcat 运行它时遇到此错误。

java.lang.ClassCastException: org.glassfish.jersey.server.internal.RuntimeDelegateImpl cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory
    at org.jboss.resteasy.spi.ResteasyProviderFactory.getInstance(ResteasyProviderFactory.java:353)
    at org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.checkClientExceptionMapper(ApacheHttpClient4Executor.java:72)
    at org.jboss.resteasy.client.core.executors.ApacheHttpClient4Executor.<init>(ApacheHttpClient4Executor.java:126)
    at org.openstack4j.connectors.resteasy.executors.ApacheHttpClientExecutor.<init>(ApacheHttpClientExecutor.java:24)
    at org.openstack4j.connectors.resteasy.executors.ApacheHttpClientExecutor.create(ApacheHttpClientExecutor.java:48)
    at org.openstack4j.connectors.resteasy.HttpCommand.initialize(HttpCommand.java:43)
    at org.openstack4j.connectors.resteasy.HttpCommand.create(HttpCommand.java:37)
    at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:51)
    at org.openstack4j.connectors.resteasy.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:30)
    at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
    at org.openstack4j.openstack.internal.OSAuthenticator.authenticateV3(OSAuthenticator.java:154)
    at org.openstack4j.openstack.internal.OSAuthenticator.invoke(OSAuthenticator.java:70)
    at org.openstack4j.openstack.client.OSClientBuilder$ClientV3.authenticate(OSClientBuilder.java:165)
    at org.openstack4j.openstack.client.OSClientBuilder$ClientV3.authenticate(OSClientBuilder.java:128)

openstack4j v2 没有出现此问题。

java openstack openstack-swift openstack4j
1个回答
1
投票

我在我的 Maven 项目上使用 3.0.4 版本时遇到了同样的问题。 将依赖项升级到 3.1.0 解决了这个问题。 以下是包含的工件详细信息:

<dependency>
   <groupId>org.pacesys</groupId>
   <artifactId>openstack4j</artifactId>
   <version>3.1.0</version>
</dependency>
© www.soinside.com 2019 - 2024. All rights reserved.