[keycloak-user] Keycloak event-listener-sysout example not working , v4.6.0.Final

abhilashreddy abhi vedavallyabhilash at gmail.com
Tue Nov 27 09:50:30 EST 2018


Hello,

I am using 4.6.0.Final keycloak version and  trying out event-sysout
example (
https://github.com/keycloak/keycloak/tree/master/examples/providers/event-listener-sysout)
,but i am unable to make it work and getting following errors

1) I have created a spring boot application with following classes
                      --Application.class (Contains Main method)
                      --SysoutEventListenerProvider
                     ---SysoutEventListenerProviderFactory
    I have placed org.keycloak.events.EventListenerProviderFactory file in
src/main/resources/META-INF/services  which points to my
SysoutEventListenerProviderFactory.
    Did a maven clean install and took the jar from target folder and tried
placing it any one of  standalone/deployments folder ,
Keycloak_Home/providers folder and also created as a module as per
    instructions in documentation  but all of the above methods throws the
following error.

Caused by: java.util.ServiceConfigurationError:
org.keycloak.events.EventListenerProviderFactory: Provider
com.example.demo.springboot.SysoutEventListenerProviderFactory not found
        at java.util.ServiceLoader.fail(Unknown Source)
        at java.util.ServiceLoader.access$300(Unknown Source)
        at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
        at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
        at java.util.ServiceLoader$1.next(Unknown Source)
        at
org.keycloak.provider.DefaultProviderLoader.load(DefaultProviderLoader.java:60)
        at
org.keycloak.provider.ProviderManager.load(ProviderManager.java:92)
        at
org.keycloak.services.DefaultKeycloakSessionFactory.loadFactories(DefaultKeycloakSessionFactory.java:214)
        at
org.keycloak.services.DefaultKeycloakSessionFactory.init(DefaultKeycloakSessionFactory.java:80)
        at
org.keycloak.services.resources.KeycloakApplication.createSessionFactory(KeycloakApplication.java:331)
        at
org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:118)

2) This time, I have removed Application.class and exported the jar using
export->jar in eclipse and tried placing it in deployment folder or
providers or as a module  and the application starts   but throws the
 following log.

               ERROR [org.keycloak.events.EventBuilder] (default task-1)
Event listener 'sysout' registered, but provider not found

Can someone please help me with what I am missing?

Thanks
Abhilash


More information about the keycloak-user mailing list