Keycloak Admin Client within Quarkus - java.lang.IncompatibleClassChangeError

别说谁变了你拦得住时间么 提交于 2020-02-21 05:59:28

问题


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>

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

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?


回答1:


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

So, you should use Resteasy version 3.x.



来源:https://stackoverflow.com/questions/58065789/keycloak-admin-client-within-quarkus-java-lang-incompatibleclasschangeerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!