Repository navigation
Replies: 3 comments 8 replies
Did you pass in a Client to the KeycloakBuilder, or did you let it create one? If you are passing in a CXF Client, that will not work. If you are not passing one in, then I would expect ClientBuilderWrapper to only instanciate a resteasy client builder, which seems to only be able to provide a resteasy impl, not a CXF one. |
That is the issue. ResteasyClientBuilder does not in fact ensure that a Resteasy client is returned. It is looking generically for a ClientBuilder. To continue to use ResteasyClientBuilder you would like need to debug the FactoryFinder.find to determine how it could pick the implementation of your choosing. For example it tries to do a ServiceLoader lookup first, does the resteasy implemenation have a META-INF/services/jakarta.ws.rs.client.ClientBuilder entry? Alternatively it's probably simply to just rely on the ClientBuilderWrapper - if you haven't installed other ResteasyClientProviders it should be usable via the Keycloak client provider static method: That client instance should then be usable by the KeycloakBuilder. |
|
I tried to use what you provided verbatim and it doesn't appear it can be used that way. These methods aren't available. The only way to create is like this though I haven't tried what I have below yet to see if it works. |
Uh oh!
There was an error while loading. Please reload this page.
I'm currently am using
keycloak-admin-clientversion 23.0.5. I wrote used the client code belong for a provider class I have implemented using RESTEasy 6.2.4 in my app which is using Spring 6 and Jetty 12 standalone server.When the application starts, I get this exception
To resolve this, I had to exclude
cxf-rt-rs-clientbecause it was choosing Apache CXF instead of RESTEasy CXF when it threw this exception from thebuild()operation. This was all about class loader not finding the right context.My question on this is what about other areas of code that a developer may want to use Apache CXF instead of RESTEasy CXF? This issue didn't exist with the Java 8 version and only started in the upgraded Java 17 Jakarta version I'm working on. I excluded the choices and now RESTEasy is the only choice because of context issues. Somehow RESTEasy needs to understand context on what to choose, hence class loader...unless I am understanding this all wrong and I'm missing something here to have it pick the right target class.
Is this a bug or am I doing something wrong?
All reactions