I’m using Keycloak 26.1.3 (Quarkus distribution, Windows) and I created a custom SPI.
My first version was packaged as custom-spi-13.0.0.jar and I placed it in the providers folder.
Later I created a new version called custom-spi-14.0.0.jar. I deleted the old JAR and copied the new one.
When I run Keycloak, it still complains that it is expecting the 13.0.0 JAR.
Things I tried:
Deleted the old JAR (custom-spi-13.0.0.jar).
Put the new JAR (custom-spi-14.0.0.jar) in providers.
Deleted the folders data/ and lib/quarkus/.
Ran kc.bat build.
At this point I get the following error:
F:\keycloak\bin>kc.bat build
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
Caused by: picocli.CommandLine$InitializationException: Could not instantiate and add subcommand org.keycloak.quarkus.runtime.cli.command.Export: java.lang.RuntimeException: java.nio.file.NoSuchFileException: F:\keycloak\lib\..\providers\jakarta.ws.rs-api-3.1.0.jar......
So it looks like Keycloak is still trying to load cached metadata for the old version and fails when it’s missing.