Trying to register SPI causes build step error
See original GitHub issueDescribe the bug
I have written a User Storage Provider and it worked fine in versions before 17. When trying to register it with Keycloak 17, I get the exception message:
Build step org.keycloak.quarkus.deployment.KeycloakProcessor#configureProviders threw an exception: java.util.ServiceConfigurationError: org.keycloak.provider.Spi: org.keycloak.locale.LocaleSelectorSPI not a subtype
I have reproduced this issue using Java 11 and 17 on both Windows and Linux.
Version
17.0.0
Expected behavior
When I copy the JAR file into the providers
directory and run ./kc.sh build
, a success message is printed and the provider is registered.
Actual behavior
The following error is printed:
How to Reproduce?
- Create an Provider and a ProviderFactory class. No special logic aside from the implementations are required.
- Register the Factory class in the META-INF/services/org.keycloak.storage.UserStorageProviderFactory file.
- Create the JAR file using
mvn clean compile assembly:single
- Copy the JAR file into Keycloak’s
providers
directory. - Run
./kc.sh build
Anything else?
My folder structure:
My pom.xml
file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.collinalpert</groupId>
<artifactId>my-user-provider</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.release>${java.version}</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<version>17.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<finalName>my-user-provider</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
</plugins>
</build>
</project>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How I can proper handle the SPI read register function? I am ...
I am working in stmcubeide and trying to find a problem in dubbing which is based on spi_read function. All am doing is...
Read more >What Could Go Wrong: SPI | Hackaday
Serial Peripheral Interface (SPI) is not really a protocol, but more of a general idea. It's the bare-minimum way to transfer a lot...
Read more >Error with SPI Communication using DMA
The code on bus 5 runs perfectly until I make a slave request on bus 1. From then on, the data sent over...
Read more >AM4378 error in booting from SPI Flash - Processors forum
Are you trying to boot from SPI or use SPI after booting? ... to include "$uboot/drivers/spi/omap3_spi.c" file into the u-boot build:
Read more >STM32F407 SPI RXNE flag bit clears automatically
As this is an example I am trying to build, I skipped to exit the ... the RXNE bit gets cleared even when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding
<scope>provided</scope>
to the Keycloak dependencies solved my issue. Thanks!Thank you so much. I had the same issue with keycloak 18 and this post sort of fixed my issues for once due to the detailed steps provided to reproduce it. Thanks again! Appreciate!