[keycloak-user] Admin Client

Marko Strukelj mstrukel at redhat.com
Mon Oct 31 17:40:56 EDT 2016


That error can happen when jboss modules dependencies are misconfigured.
RealmRepresentation class is part of keycloak-core module, and should only
be available through that module. What that means is that you should
declare a dependency on keycloak-core module in your module (whatever that
is - maybe jboss-deployment-structure.xml for your .war), but make sure not
to reexport the dependency content.

The following for example would be a wrong way to declare a module
dependency:

<module name="org.keycloak.keycloak-core" export="true"/>

On Tue, Jul 10, 2018 at 7:03 PM, Bruno Palermo <palermo at pobox.com> wrote:

> Hi,
>
>
> I'm trying to use the keycloak-admin-client.
>
>
> Keycloak kc = KeycloakBuilder.builder()
>
>     .serverUrl(serverUrl)
>
>     .realm("master")
>
>     .username("username")
>
>     .password("password")
>
>     .clientId("admin-cli")
>
>     .resteasyClient(new ResteasyClientBuilder().
> connectionPoolSize(10).build())
>
>     .build();
>
>
> UserRepresentation user = kc.realm(realm)
>
>     .users()
>
>     .get("userId")
>
>     .toRepresentation();
>
>
> But returns an error:
>
>
> Caused by: java.lang.LinkageError: loader constraint violation: loader
> (instance of org/jboss/modules/ModuleClassLoader) previously initiated
> loading for a different type with name "org/keycloak/representations/
> idm/RealmRepresentation"
>
>
> Any ideas?
>
>
> Thanks,
>
> Bruno
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list