Quarkus中的Keycloak Admin客户端-java.lang.IncompatibleClassChangeError [英] Keycloak Admin Client within Quarkus - java.lang.IncompatibleClassChangeError

查看:179
本文介绍了Quarkus中的Keycloak Admin客户端-java.lang.IncompatibleClassChangeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Quarkus 编写一套微服务.这些服务将使用 Quarkus的Keycloak扩展名受到保护.交互作用很好,没有问题.现在,我正在尝试向微服务中添加一些功能,这些功能实质上将代理与Keycloak的通信,并允许我使用 Keycloak 管理客户端.我已经将Keycloak管理客户端依赖项添加到了pom.xml:

I'm writing a suite of microservices using Quarkus. These services will be protected using Quarkus' Keycloak extension. That interaction works great and without problem. Now I'm trying to add functionality to my microservices that will essentially broker communication with Keycloak and allow me to create users/groups/roles programmatically using the Keycloak admin client. I've added the Keycloak admin client dependency to my pom.xml:

    <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-admin-client</artifactId>
        <version>${version.keycloak}</version>
    </dependency>

我的代码也可以正常编译.但是,当我运行它并尝试获取例如Keycloak领域内的用户列表时,出现以下异常:

My code also compiles with no problem. However, when I run it and attempt to, for example, get a list of users within my Keycloak realm, I get the following exception:

java.lang.IncompatibleClassChangeError: Found interface org.jboss.resteasy.client.jaxrs.ResteasyClient, but class was expected

我以前在其他项目中已经实现了这样的功能,但是从来没有人使用Quarkus作为其底层实现框架.因此,我想这可能与此有关.但是我从未见过这样的错误.谁能给我一些有关如何解决此问题的见解?

I've implemented functionality like this before in other projects, but never one that uses Quarkus as its underlying implementation framework. So, my guess is it has something to do with that. But I've never seen an error like this. Can anyone give me some insight into how to get around this issue?

推荐答案

java.lang.IncompatibleClassChangeError之所以被抛出,是因为从Resteasy版本4.0开始,org.jboss.resteasy.client.jaxrs.ResteasyClient已从类更改为接口.

java.lang.IncompatibleClassChangeError is thrown because org.jboss.resteasy.client.jaxrs.ResteasyClient has been changed from class to interface since Resteasy version 4.0.

  • ResteasyClient.java in version 3.9
  • ResteasyClient.java in version 4.0

因此,您应该使用Resteasy版本3.x.

So, you should use Resteasy version 3.x.

这篇关于Quarkus中的Keycloak Admin客户端-java.lang.IncompatibleClassChangeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆