Giter Club home page Giter Club logo

Comments (15)

mhuin avatar mhuin commented on July 4, 2024

Hi John,
Can you try and follow the steps described there? http://www.janua.fr/keycloak-spi-adding-a-custom-event-listener-module/

This module was based on the sysout example, so this should work similarly.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

So you used the jboss-cli.sh rather than the manual approach of copying files? But you still edited the standalone.xml file manually?

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

This is what I did

cd ~/SpringBoot/keycloak/keycloak-6.0.1

bin/jboss-cli.sh --command="module add --name=org.softwarefactory.keycloak.mqtt --resources=~/SpringBoot/keycloak-event-listener-mqtt/target/event-listener-mqtt-jar-with-dependencies.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi"

edit standalone/configuration/standalone.xml

    <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
        <web-context>auth</web-context>
        <providers>
            <provider>classpath:${jboss.home.dir}/providers/*</provider>
            <!-- this is the line I have added -->
            <provider>module:org/softwarefactory/keycloak/mqtt</provider>
        </providers>

and exaqctly the same problem

16:24:40,028 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
at [email protected]//org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)

I am using keycloak 6.0.1. I have tried 7.0.0 and same problem. Running on mint linux 19.x

MQTTEventListenerProvider.java
package org.softwarefactory.keycloak.providers.events.mqtt;

from keycloak-event-listener-mqtt.

mhuin avatar mhuin commented on July 4, 2024

Copying event-listener-mqtt-jar-with-dependencies.jar to ${KEYCLOAK_HOME}/standalone/deployments is enough to get the listener available. You then have to activate it in the realm's events config page in the GUI.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

from keycloak-event-listener-mqtt.

mhuin avatar mhuin commented on July 4, 2024

I meant that you don't have to edit the standalone.xml file to make it work; putting the jar in the deployments directory is enough. I'll update the README with clearer installation instructions.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

from keycloak-event-listener-mqtt.

mhuin avatar mhuin commented on July 4, 2024

Sorry, as you can see the last changes to the code were from 6 months ago, and I didn't document my process at the time. It turns out the instructions on janua.fr didn't apply after all. If you follow the steps in the README (I just tested it myself and updated the README a few minutes ago) it should work as expected.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

from keycloak-event-listener-mqtt.

mhuin avatar mhuin commented on July 4, 2024

no, running this is not needed.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

well how will keycloak know where the jar is?
Ah - under resource root. So still useful to put the jar within keycloak.

from keycloak-event-listener-mqtt.

mhuin avatar mhuin commented on July 4, 2024

the standalone/deployments directory in keycloak's home is special, whatever gets added there is hot-deployed. You can make sure the dynamic loading worked by looking for a .deployed file with the jar name in that directory; or you can check keycloak's logs.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

Matthieu, firstly sorry for the delay. I had a BSOD and had to move a load of VMs.
So I did what was described in the readme file and now have a different problem which may be to do with the actual jar itself.

08:54:18,857 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "event-listener-mqtt-jar-with-dependencies.jar")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit."event-listener-mqtt-jar-with-dependencies.jar".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment "event-listener-mqtt-jar-with-dependencies.jar"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
Caused by: java.util.zip.ZipException: zip END header not found"}}

Any ideas of the cause of this?

Keycloak does then run but I don't think it has loaded the mqtt jar. And going to the admin console, events, config, mqtt does not show up on the list event listeners, just the two defaults.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

Mathhieu, I am giving up on this. Followed the instructions using keycloak 6.0.1 and just can't get it to work.
More inportantly I am giving up on user registration within keycloak. I think it is badly thought out but will raise concerns on the mailing list.

from keycloak-event-listener-mqtt.

norricorp avatar norricorp commented on July 4, 2024

Actually just found a event-listener-mqtt-jar-with-dependencies.jar.failed file which is created when the module is not loaded at startup.
"{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"event-listener-mqtt-jar-with-dependencies.jar\".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"event-listener-mqtt-jar-with-dependencies.jar\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
Caused by: java.util.zip.ZipException: zip END header not found"}}"

Is the jar corrupted? There were no errors during build.

from keycloak-event-listener-mqtt.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.