[keycloak-user] SysoutEventListenerProvider example is not working

Stian Thorgersen sthorger at redhat.com
Wed May 25 03:45:14 EDT 2016


Looks like you've mixed the instructions. If you copy the jar to providers
directory you don't need to register the module, that's only when you're
deploying as a module.

On 25 May 2016 at 09:23, Sarp Kaya <akaya at expedia.com> wrote:

> Hello,
>
> I have followed the instructions in the provided example (from
> keycloak-examples-1.9.4.Final.zip). The steps I have done are:
>
>
>    1. ran mvn clean install
>    2. Copied event-listener-sysout-example.jar file from target to
>    providers directory in keycloak
>    3. Registered provider in keycloak-server.json
>    4. Restarted the standalone server
>
> I am getting the error below now:
>
> 07:12:51,542 INFO  [org.keycloak.services] (ServerService Thread Pool --
> 55) KC-SERVICES0001: Loading config from
> /opt/jboss/keycloak/standalone/configuration/keycloak-server.json
> 07:12:51,946 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool
> -- 55) MSC000001: Failed to start service
> jboss.undertow.deployment.default-server.default-host./auth:
> org.jboss.msc.service.StartException in service
> jboss.undertow.deployment.default-server.default-host./auth:
> java.lang.RuntimeException: RESTEASY003325: Failed to construct public
> org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
>         at
> org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         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)
>         at org.jboss.threads.JBossThread.run(JBossThread.java:320)
> Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct
> public
> org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
>         at
> org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:162)
>         at
> org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2209)
>         at
> org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:299)
>         at
> org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:240)
>         at
> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
>         at
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
>         at
> io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
>         at
> org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
>         at
> io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
>         at
> io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
>         at
> io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
>         at
> io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
>         at
> org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
>         at
> org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
>         ... 6 more
> Caused by: java.lang.RuntimeException:
> org.jboss.modules.ModuleNotFoundException:
> org.keycloak.examples.event-sysout:main
>         at
> org.keycloak.provider.wildfly.ModuleProviderLoaderFactory.create(ModuleProviderLoaderFactory.java:44)
>         at
> org.keycloak.provider.ProviderManager.<init>(ProviderManager.java:56)
>         at
> org.keycloak.services.DefaultKeycloakSessionFactory.init(DefaultKeycloakSessionFactory.java:71)
>         at
> org.keycloak.services.resources.KeycloakApplication.createSessionFactory(KeycloakApplication.java:225)
>         at
> org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:77)
>         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:423)
>         at
> org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150)
>         ... 19 more
> Caused by: org.jboss.modules.ModuleNotFoundException:
> org.keycloak.examples.event-sysout:main
>         at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:223)
>         at
> org.keycloak.provider.wildfly.ModuleProviderLoaderFactory.create(ModuleProviderLoaderFactory.java:40)
>         ... 28 more
>
> 07:12:51,976 ERROR [org.jboss.as.controller.management-operation]
> (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address:
> ([("deployment" => "keycloak-server.war")]) - failure description:
> {"WFLYCTL0080: Failed services" =>
> {"jboss.undertow.deployment.default-server.default-host./auth" =>
> "org.jboss.msc.service.StartException in service
> jboss.undertow.deployment.default-server.default-host./auth:
> java.lang.RuntimeException: RESTEASY003325: Failed to construct public
> org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
>     Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to
> construct public
> org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
>     Caused by: java.lang.RuntimeException:
> org.jboss.modules.ModuleNotFoundException:
> org.keycloak.examples.event-sysout:main
>     Caused by: org.jboss.modules.ModuleNotFoundException:
> org.keycloak.examples.event-sysout:main"}}
>
>
>
> Am I missing an unknown step? The readme file only mentions copying the
> jar file to providers. If not what could be wrong?
>
> Kind Regards,
> Sarp Kaya
>
> _______________________________________________
> 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/20160525/7b09b686/attachment-0001.html 


More information about the keycloak-user mailing list