在Keycloak中配置事件监听器

时间:2016-10-20 11:54:32

标签: jboss listener wildfly keycloak

我正在Wildfly 9.0.1中的KeyCloak中配置一个事件监听器。 我创建了一个带有两个clases的.jar,实现了一个像Keycloak这样的提供者在他的github的例子中解释过。

在这个例子中,Keycloak的人解释说有必要注册提供者编辑“standalone / configuration / standalone.xml”并将模块添加到providers元素。 我在标签“子系统”中编写了这个定义:

<spi name="eventsListener">
  <provider name="my-event-listener" enabled="true">
    <properties>
      <property name="max" value="100" />
    </properties>
  </provider>
</spi>

当我启动服务器时,它会给我一个错误:

ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
	at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
	at org.jboss.as.server.ServerService.boot(ServerService.java:350)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: Unknown keycloak-server subsystem tag: spi
	at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:55)
	at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:39)
	at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
	at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
	at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1199)
	at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:457)
	at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
	at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106)
	at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
	at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
	at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
	... 3 more

FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

有人知道出了什么问题吗?我需要帮助。

谢谢你。

1 个答案:

答案 0 :(得分:0)

我认为您必须在<subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">

中编写您的定义