Keycloak: Custom Event Listener referencing third party libraries

时间:2019-03-19 15:17:52

标签: java jar keycloak

I am trying to build a custom event listener for Keycloak, which should use RabbitMQ (a third party library for an event bus implementation) to publish an event whenever a user registers.

I already managed to implement the example from the Keycloak documentation. But as soon as I reference the RabbitMQ Client Library in my pom.xml, I receive an error in the console as soon as I select my custom event listener in the Keycloak admin console. The error message says: "Uncaught server error: java.lang.NoClassDefFoundError: com/rabbitmq/client/ConnectionFactory".

I also tried to add the .jar file with the RabbitMQ client library to my src-folder as described here, but that doesn't change anything.

I'm relatively new to Java deployment, so probably I am missing something obvious here. I hope that there is anybody who can help me.

-timnot90

1 个答案:

答案 0 :(得分:0)

找到了一个解决方案:我现在正在使用maven-shade-plugin,如http://lists.jboss.org/pipermail/keycloak-user/2016-April/005902.html(安东尼的回答)所述,该程序将我的第三方库的.class文件直接放入.jar-文件。