[keycloak-user] Keycloak WildFly9 Adapter ClassNotFoundException for org.keycloak.adapters.spi.HttpFacade

alex orl alex_orl1079 at yahoo.it
Tue Nov 17 08:38:25 EST 2015


i got jboss deployment descriptor:
<jboss-deployment-structure>    <deployment>        <dependencies>            <module name="org.keycloak.keycloak-adapter-spi"/>        </dependencies>    </deployment></jboss-deployment-structure>
should be the answer. 


     Il Martedì 17 Novembre 2015 13:35, alex orl <alex_orl1079 at yahoo.it> ha scritto:
   

 hi to all,i'm facing up to a class loading issue after i migrated from keycloak 1.5.0 final to keycloak 1.6.1 final.My application server is jboss WF9.Specifically i developed my multitenant module following your example.On Keycloak 1.5.0 adapter i saw that interface 
org.keycloak.adapters.spi.HttpFacade
was in the keycloak-adapter-core dependency while in the 1.6.1  it was moved into keycloak-adapter-spi.
I've referenced these depencencies as provided scoped in my project pom (as showed in the example too):
         <dependency> <groupId>org.keycloak</groupId> <artifactId>keycloak-adapter-core</artifactId> <version>1.6.1.Final</version> <scope>provided</scope> </dependency>           <dependency>            <groupId>org.keycloak</groupId>            <artifactId>keycloak-adapter-spi</artifactId>            <version>1.6.1.Final</version>            <scope>provided</scope>        </dependency>
I have installed the wf9 adapter adding:<extensions>    <extension module="org.keycloak.keycloak-adapter-subsystem"/>        ...</extensions>...     <profile>    <subsystem xmlns="urn:jboss:domain:keycloak:1.1"/>    ...</profile>

and 
<server xmlns="urn:jboss:domain:1.4">    <subsystem xmlns="urn:jboss:domain:security:1.2">        <security-domains>        ...        <security-domain name="keycloak">        <authentication>            <login-module code="org.keycloak.adapters.jboss.KeycloakLoginModule" flag="required"/>        </authentication>    </security-domain></security-domains>
and eventually by copying the modules folder into the wf9 modules directory.When i deploy my
org.keycloak.adapters.KeycloakConfigResolver

implementation i get this error:
        ...]13:02:55,997 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."myapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myapp.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "myapp.war"        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)        at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class multitenancy.keycloak.PathBasedKeycloakConfigResolver with ClassLoader ModuleClassLoader for Module "deployment.myapp.war:main" from Service Module Loader        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)        at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:107)        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:92)        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77)        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)        ... 5 moreCaused by: java.lang.NoClassDefFoundError: org/keycloak/adapters/spi/HttpFacade$Request        at java.lang.Class.getDeclaredMethods0(Native Method)        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)        at java.lang.Class.getDeclaredMethods(Class.java:1975)        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65)        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)        ... 10 moreCaused by: java.lang.ClassNotFoundException: org.keycloak.adapters.spi.HttpFacade$Request from [Module "deployment.myapp.war:main" from Service Module Loader]        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)        ... 15 more

Why the keycloak-adapter-spi-1.6.1.Final.jar is not loaded by keycloak-adapter-spi module?
If i decide to include the jar inside the myapp.war archive...after deployment i get a Linkage exception error.What am i doing wrong?
thanks

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151117/b67cddf5/attachment.html 


More information about the keycloak-user mailing list