p2-inc / keycloak-events

Useful Keycloak event listener implementations and utilities.
https://phasetwo.io
Other
194 stars 37 forks source link

Bug: NoSuchMethodError exception when using webhook event listener #74

Closed brutaldev closed 1 month ago

brutaldev commented 1 month ago

One fresh install of Keycloak 25.0.4, just dropping the latest jar file into "providers", adding the ext-event-webhook to the event listeners lists and using WEBHOOK_URI, I see the following error in the Docker console whenever any event occurs:

2024-09-27 17:34:57 2024-09-27 16:34:57,499 WARN  [io.phasetwo.keycloak.events.SenderEventListenerProvider] (pool-5-thread-1) Uncaught Sender error: java.lang.NoSuchMethodError: 'org.keycloak.broker.provider.util.SimpleHttp org.keycloak.broker.provider.util.SimpleHttp.doPost(java.lang.String, org.apache.http.client.HttpClient)'
2024-09-27 17:34:57     at io.phasetwo.keycloak.events.HttpSenderEventListenerProvider.send(HttpSenderEventListenerProvider.java:76)
2024-09-27 17:34:57     at io.phasetwo.keycloak.events.WebhookSenderEventListenerProvider.send(WebhookSenderEventListenerProvider.java:142)
2024-09-27 17:34:57     at io.phasetwo.keycloak.events.SenderEventListenerProvider.lambda$schedule$0(SenderEventListenerProvider.java:111)
2024-09-27 17:34:57     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
2024-09-27 17:34:57     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
2024-09-27 17:34:57     at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
2024-09-27 17:34:57     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
2024-09-27 17:34:57     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
2024-09-27 17:34:57     at java.base/java.lang.Thread.run(Thread.java:1583)
xgp commented 1 month ago

@brutaldev Can you verify the jar version you are using?

brutaldev commented 1 month ago

@xgp The latest released one "keycloak-events-0.28-kc22.jar" https://github.com/p2-inc/keycloak-events/releases/download/v0.28-kc22/keycloak-events-0.28-kc22.jar

Is this only for KC22?

brutaldev commented 1 month ago

OK that's a pretty old version (latest being 0.32) Do you publish the jar files anywhere or should I just grab one out of the latest docker container?

xgp commented 1 month ago

We publish everything to maven central

https://repo1.maven.org/maven2/io/phasetwo/keycloak/keycloak-events/

xgp commented 1 month ago

I added a note to the README https://github.com/p2-inc/keycloak-events/tree/main?tab=readme-ov-file#releases