-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating standalone.xml causes keycloak not to start #1
Comments
Hi John, This module was based on the sysout example, so this should work similarly. |
So you used the jboss-cli.sh rather than the manual approach of copying files? But you still edited the standalone.xml file manually? |
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
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 I am using keycloak 6.0.1. I have tried 7.0.0 and same problem. Running on mint linux 19.x MQTTEventListenerProvider.java |
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. |
I agree that should happen but it is not starting. The extra line in
standalone.xml is preventing it from starting.
…------ Original Message ------
From: "Matthieu Huin" <[email protected]>
To: "mhuin/keycloak-event-listener-mqtt"
<[email protected]>
Cc: "norricorp" <[email protected]>; "Author"
<[email protected]>
Sent: 07/10/2019 17:14:12
Subject: Re: [mhuin/keycloak-event-listener-mqtt] updating
standalone.xml causes keycloak not to start (#1)
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEUBLYPA2XW2U72RG5MEQALQNNN5JANCNFSM4I4TWF6Q>.
|
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. |
So having copied the module to modules via jboss-cli.sh, I then have
under modules
org/softwarefactory/keycloak/mqtt/main:
event-listener-mqtt-jar-with-dependencies.jar module.xml
where module.xml is
<?xml version='1.0' encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.1"
name="org.softwarefactory.keycloak.mqtt">
<resources>
<resource-root
path="event-listener-mqtt-jar-with-dependencies.jar"/>
</resources>
<dependencies>
<module name="org.keycloak.keycloak-core"/>
<module name="org.keycloak.keycloak-server-spi"/>
</dependencies>
</module>
standalone.xml is untouched as you suggested. Keycloak now starts.
I open a browser, log into keycloak and go to events. Under the events
tab, the only two event listeners are jboss-logging and email (ie the
defaults). There is no MQTT.
So I am not sure how you got this to work, especially as you said that
you followed the instruction at janua.fr, which does include updating
standalone.xml.
Regards,
John
|
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. |
Looked thru' the readme.
Do I still need to run jboss-cli.sh to copy the jar and create a
module.xml?
|
no, running this is not needed. |
well how will keycloak know where the jar is? |
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. |
Matthieu, firstly sorry for the delay. I had a BSOD and had to move a load of VMs. 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" 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. |
Mathhieu, I am giving up on this. Followed the instructions using keycloak 6.0.1 and just can't get it to work. |
Actually just found a event-listener-mqtt-jar-with-dependencies.jar.failed file which is created when the module is not loaded at startup. Is the jar corrupted? There were no errors during build. |
I have compiled the code and copied jar to modules/org/soft*/key*/prov*/events/mqtt/main and created module.xml as docs in 6.2.2 of the Server Developer docs
Then updated standalone.xml
Running standalone.sh -b 0.0.0.0 gives
.war (runtime-name: keycloak-server.war) in 255ms
09:43:01,955 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)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
......
Removing the additional line and all is well. Assuming there is no daft error in the xml, then would the problem be that the system finds the generated jar and reacts badly to that?
But having said that, the error complains about microprofile-metrics-smallrye:2.0, so should that be commented out? I also saw this https://developer.jboss.org/thread/280621.
Regards,
John
The text was updated successfully, but these errors were encountered: