[keycloak-user] Migration issues from KC 1.5 to 1.9

Jeff Picklyk jpicklyk at gmail.com
Thu Mar 3 09:21:34 EST 2016


Hi Stian, thank you for following up.

To keep things simple the application is working on the full KC
1.5.0.Final.zip distribution but not on the 1.9.0.Final.zip distribution.
My war file is secured by KC and has the keycloak.json file updated when I
attempt to use the 1.9 distribution.

I do use the admin client and the representation classes to retrieve data
from the server which all works fine in 1.5.0.

Here are further details from my POM file.

<jackson.version>2.5.4</jackson.version>
<resteasy.version>3.0.14.Final</resteasy.version>
<deltaspike.version>1.5.0</deltaspike.version>
<keycloak.version>1.9.0.Final</keycloak.version>

<!-- Keycloak dependencies -->
<dependency>
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-core</artifactId>
    <scope>provided</scope>
    <version>${keycloak.version}</version>
</dependency>
<dependency>
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-adapter-core</artifactId>
    <scope>provided</scope>
    <version>${keycloak.version}</version>
</dependency>
<!-- Keycloak client -->
<dependency>
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-admin-client</artifactId>
    <version>${keycloak.version}</version>
</dependency>

<!-- Resteasy dependancies -->
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client</artifactId>
        <version>${resteasy.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson2-provider</artifactId>
        <version>${resteasy.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
        <scope>provided</scope>
    </dependency>
    <!--Use Jackson for data binding -->
    <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-json-provider</artifactId>
        <version>${jackson.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- Jackson hibernate module to support @Entity automagically -->
    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-hibernate4</artifactId>
        <version>${jackson.version}</version>
    </dependency>
    <!-- Jackson module to support Java 8 JSR-310 -->
    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
        <version>${jackson.version}</version>
    </dependency>
</dependencies>


On Thu, Mar 3, 2016 at 1:26 AM, Stian Thorgersen <sthorger at redhat.com>
wrote:

> Do you have the Keycloak adapter subsystem installed? Is your WAR secured
> by Keycloak? If so it should have the required dependencies with the
> exception of the admin client. If no to those questions you need to add a
> dependency to keycloak-core.
>
> On 2 March 2016 at 15:10, Jeff Picklyk <jpicklyk at gmail.com> wrote:
>
>> Hi all,
>>
>> I have an Java EE7 application using KC on wildfly and I'm porting it
>> over to work on KC 1.9.0.Final and Wildfly 10.  The issue I'm running into
>> has the following stack trace:
>>
>> 15:36:18,209 INFO  [org.hibernate.orm.deprecation] (ServerService Thread
>> Pool -- 78) HHH90000001: Found usage of deprecated setting for specifying
>> Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner]
>> instead
>> 15:36:18,452 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7)
>> MSC000001: Failed to start service
>> jboss.deployment.unit."portal.war".POST_MODULE:
>> org.jboss.msc.service.StartException in service
>> jboss.deployment.unit."portal.war".POST_MODULE: WFLYSRV0153: Failed to
>> process phase POST_MODULE of deployment "portal.war"
>> at
>> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
>> 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
>> net.sbs.portal.business.registrar.control.UserAsyncManager with ClassLoader
>> ModuleClassLoader for Module "deployment.portal.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:106)
>> at
>> org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
>> at
>> org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
>> at
>> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
>> ... 5 more
>> Caused by: java.lang.NoClassDefFoundError:
>> org/keycloak/representations/idm/UserRepresentation
>> at java.lang.Class.getDeclaredMethods0(Native Method)
>> at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
>> at java.lang.Class.getDeclaredMethods(Class.java:1967)
>> at
>> org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:80)
>> at
>> org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
>> ... 10 more
>> Caused by: java.lang.ClassNotFoundException:
>> org.keycloak.representations.idm.UserRepresentation from [Module
>> "deployment.portal.war:main" from Service Module Loader]
>> at
>> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
>> at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
>> at
>> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
>> at
>> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
>> ... 15 more
>>
>>
>>
>> My UserAsyncManager class is just a SLSB with an @Asynchronous method to
>> take the KC UserRepresentation and save it to my application database for
>> further usage.  I am using the Keycloak-admin-client in my application to
>> retrieve the user representation from the KC server.
>>
>> I've been struggling to find a solution to this problem for a few days
>> and need some help from the community.  The relevant POM dependency
>> versions are the following:
>>
>> <jackson.version>2.5.4</jackson.version>
>> <resteasy.version>3.0.14.Final</resteasy.version>
>> <deltaspike.version>1.5.0</deltaspike.version>
>> <keycloak.version>1.9.0.Final</keycloak.version>
>>
>> I can include the full POM if needed.
>>
>> Any thoughts?
>>
>> Thanks,
>> Jeff
>>
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/keycloak-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160303/df0ea304/attachment-0001.html 


More information about the keycloak-user mailing list