I have created a custom event listener in keycloak which was working fine in version 7 and stops working after upgrade to version 8.0.1.
Similar to this i have other providers for Email,Realm resource Provider,Theme resource provider are there, which is working perfectly without any issues,Only above mentioned provider having problem. Not able to figure out the cause, Can someone please help on this
The error is on line 17, thatās my guess based on the information you provided.
Without seeing some code if just a guessing game on what could be wrong.
Maybe the interface changed or with the upgrade the events are not active or your event listener is not setup.
Looks okay.
Can you take a look in your server info and see if itās picked up. (auth/admin/master/console/#/server-info/providers)
Also take a look at Events > Config [tab] under your realm and see if itās activated. In your case you should see ācustomEventListnerā
Yes previously it was build using version 7 dependencies, now i have changed it to version 8 dependencies and builded fresh custom providers, even after that it is not working
Can you try building the one in the repo I linked to and deploy that one and see what it does?
Or try a more recent Keycloak version.
Iām out of ideas after that, maybe it was a bug in that specific version.
With updated version also not working. I have tried your code only⦠still no luck
Logs when deploying
15:23:33,806 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0010: Scan found incompletely copied file content for deployment /opt/6d/app/keycloak-10.0.1/standalone/deployments/event-tes.jar. Deployment changes will not be processed until all content is complete.
15:23:44,070 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0001: Content added at location /opt/6d/app/keycloak-10.0.1/standalone/data/content/3f/e01366215c80f0e8d4f4502094df928e614f56/content
15:23:44,078 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of āevent-tes.jarā (runtime-name: āevent-tes.jarā)
15:23:44,204 INFO [org.keycloak.subsystem.server.extension.KeycloakProviderDeploymentProcessor] (MSC service thread 1-4) Deploying Keycloak provider: event-tes.jar
15:23:44,344 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed āevent-tes.jarā (runtime-name : āevent-tes.jarā)
Iāll be happy to help if you can create a Github repo for your event listener.
That way I can try it out myself and take a look at it because we are getting nowhere like this.
Sorry but Iām not going to bother with this until you provide a repo which I can actually build. The example I provide in the repo is something you can start of.
The error you provided indicates that the jar isnāt build properly so maybe you should consider another project structure.
It seems you just copied my code to your project and tried that, I suggested building my repo and use that as a test.
Whats the difference if i take only the required portion from your repo and build ? I have issues with only event listener thats why i take out only that portion and builded.
I just simply builded using eclipse Export option which was working fine before.
Can you suggest me a project structure which i need to follow if you suspect issue with build ?
On first sight problems with your structure are the location of the META-INF folder and the name and location of the resource folder. Try to use a more generic and widely used project directory structure, especially when you share a git repo so anybody can build it and immediately use it without installing another IDE or changing things.
Look at the locations of the META-INF folder in my example and also the name and location of resources of the example. Thatās a more widely used structure. The log line Scan found incompletely copied file content for deployment indicates that the jar youāve build is not containing everything.
Also not everybody has Eclipse installed on their pc, I donāt and donāt want to install it.
I donāt see any reason why it should fail when you re-deploy after an upgrade.
If you can reproduce this error than I suggest you create an issue on https://issues.redhat.com/projects/KEYCLOAK/issues for it.