[keycloak-user] java.lang.NoClassDefFoundError: org/keycloak/representations/AccessTokenResponse

valsaraj pv valsarajpv at gmail.com
Tue May 22 06:41:23 EDT 2018


Which Keycloak API jar we can use to call admin APIs from Java application?

On Tue, May 22, 2018 at 4:08 PM, valsaraj pv <valsarajpv at gmail.com> wrote:

> After adding keycloak-core-3.4.3.Final.jar into ear:
>
>> 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"
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:264)
>> at com.sun.proxy.$Proxy344.<clinit>(Unknown Source)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
>> NativeConstructorAccessorImpl.java:62)
>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>> DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>> at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
>> at org.jboss.resteasy.client.jaxrs.ProxyBuilder.proxy(
>> ProxyBuilder.java:79)
>> at org.jboss.resteasy.client.jaxrs.ProxyBuilder.build(
>> ProxyBuilder.java:131)
>> at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.proxy(
>> ClientWebTarget.java:74)
>> at org.keycloak.admin.client.Keycloak.realms(Keycloak.java:114)
>> at org.keycloak.admin.client.Keycloak.realm(Keycloak.java:118)
>
>
>
> On Tue, May 22, 2018 at 3:07 PM, valsaraj pv <valsarajpv at gmail.com> wrote:
>
>>
>> Hi,
>>
>> I am getting following exception when calling admin API:
>>
>>> java.lang.NoClassDefFoundError: org/keycloak/representations/A
>>>> ccessTokenResponse
>>>
>>> at java.lang.Class.getDeclaredMethods0(Native Method)
>>>
>>> at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
>>>
>>> at java.lang.Class.privateGetPublicMethods(Class.java:2902)
>>>
>>> at java.lang.Class.getMethods(Class.java:1615)
>>>
>>> at org.jboss.resteasy.client.jaxrs.ProxyBuilder.proxy(ProxyBuil
>>>> der.java:48)
>>>
>>> at org.jboss.resteasy.client.jaxrs.ProxyBuilder.build(ProxyBuil
>>>> der.java:131)
>>>
>>> at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.
>>>> proxy(ClientWebTarget.java:74)
>>>
>>> at org.keycloak.admin.client.token.TokenManager.<init>(TokenMan
>>>> ager.java:55)
>>>
>>> at org.keycloak.admin.client.Keycloak.<init>(Keycloak.java:60)
>>>
>>> at org.keycloak.admin.client.Keycloak.getInstance(Keycloak.java:106)
>>>
>>>
>> I have added keycloak-admin-client-3.4.3.Final.jar in ear lib & set
>> dependency to following modules:
>>
>>> <module name="org.keycloak.keycloak-adapter-spi"/>
>>
>> <module name="org.keycloak.keycloak-adapter-core"/>
>>
>> <module name="org.keycloak.keycloak-common"/>
>>
>> <module name="org.keycloak.keycloak-core"/>
>>
>>
>> Thanks!
>>
>
>
>
> --
> Life is like this: "Just when we get all the answers of life.... God
> changes the question paper....
>
> Valsaraj Viswanathan
>



-- 
Life is like this: "Just when we get all the answers of life.... God
changes the question paper....

Valsaraj Viswanathan


More information about the keycloak-user mailing list