[keycloak-user] NoClassDefFoundError: org/keycloak/KeycloakPrincipal

valsaraj pv valsarajpv at gmail.com
Fri May 18 13:45:57 EDT 2018


Issue fixed when I set Keycloak modules dependency for ejb.jar in jboss
deployment descriptor.

On Tue 15 May, 2018, 6:15 PM valsaraj pv, <valsarajpv at gmail.com> wrote:

> Hi Luis,
>
> I am using wildfly adapter and no keycloak jar will be bundled in ear. Ear
> contians web.war and ejb.jar. The classes in web and ejb modules referes
> Keyclock API class. Issue is only for ejb.jar module For web module the
> keyclock adapter provides required jar.
>
>> <subsystem xmlns="urn:jboss:domain:keycloak:1.1">
>
>                 <secure-deployment name="appWEB.war">
>
>                     <realm>demo</realm>
>
>                     <resource>app</resource>
>
>
>> <use-resource-role-mappings>true</use-resource-role-mappings>
>
>                     <public-client>true</public-client>
>
>                     <auth-server-url>http://localhost:8180/auth
>> </auth-server-url>
>
>                     <ssl-required>EXTERNAL</ssl-required>
>
>
>> <principal-attribute>preferred_username</principal-attribute>
>
>                 </secure-deployment>
>
>             </subsystem>
>
> I wonder whether I should modify this conf in WildFly so that the keyclock
>    adapter modules will be available for both web & ejb modules in ear.
> In samples I see only war config for war file. How to configure ear files?
>
> Thanks!
>
> On Tue, May 15, 2018 at 5:28 PM, Luis Rodríguez Fernández <
> uo67113 at gmail.com> wrote:
>
>> Hi Valsaraj,
>>
>> Below works for me on apache-tomcat 9.0.5 with the servlet filter adapter:
>>
>> keycloak-tomcat-adapter-spi-3.4.3.Fiinal.jar
>> keycloak-servlet-adapter-spi-3.4.3.Final.jar
>> keycloak-saml-tomcat8-adapter-3.4.3.Final.jar
>> keycloak-saml-tomcat-adapter-core-3.4.3.Final.jar
>> keycloak-saml-core-public-3.4.3.Final.jar
>> keycloak-saml-core-3.4.3.Final.jar
>> keycloak-saml-adapter-core-3.4.3.Final.jar
>> keycloak-saml-adapter-api-public-3.4.3.Final.jar
>> keycloak-common-3.4.3.Final.jar
>> keycloak-adapter-spi-3.4.3.Final.jar
>>
>> Yes, most probably you will need core.jar for your adapter too
>>
>> Hope it helps,
>>
>> Luis
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2018-05-15 13:14 GMT+02:00 valsaraj pv <valsarajpv at gmail.com>:
>>
>> > Hi,
>> >
>> > I am getting following exception while deploying ear in WildFly 10.
>> Apapter
>> > is installed so no jars included in ear & no dependencies set.
>> >
>> > > Caused by: java.lang.NoClassDefFoundError:
>> > org/keycloak/KeycloakPrincipal
>> > >
>> > >     Caused by: java.lang.ClassNotFoundException:
>> > >> org.keycloak.KeycloakPrincipal from [Module
>> > >> \"deployment.app.ear.appEJB.jar:main\" from Service Module Loader]"},
>> > >
>> > >         "WFLYCTL0412: Required services that are not installed:" => [
>> > >
>> > >             "jboss.undertow.deployment.default-server.default-host./
>> > App",
>> > >
>> > >
>> > >> "org.camunda.bpm.platform.process-application-module.\"
>> > deployment.app.ear.appWEB.war:main\".NO_VIEW"
>> > >
>> > >         ]
>> > >
>> > >
>> > >
>> > Please let me know if U need to include core jar or set the subsystem
>> > dependencies. I saw in one comment that there is no need to set them
>> > explicitly.
>> > Please advise.
>> >
>> > Thanks,
>> > Valsaraj Viswanathan
>> > _______________________________________________
>> > keycloak-user mailing list
>> > keycloak-user at lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/keycloak-user
>> >
>>
>>
>>
>> --
>>
>> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>>
>> - Samuel Beckett
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>
>
>
>
> --
> 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