Hi all,
I am using the latest keycloak server 21.1.1 and i am implementing a custom provider for communicating with an external database.
I have a factory for creating an DAO implementation from an external library. Inside the library is tested that the dao is successfully created. The dao implementation has injected a mysqldatasource.
I successfully find the custom provider and is successfully configured with the properties regarding the database.
I have confirmed that the datasource has been successfully created by the properties, but once i try to create the DAO via factory i get the following error âUncaught server error: java.lang.NoClassDefFoundError:â.
I use the following dependencies:
org.keycloak:keycloak-server-spi:21.1.1
org.keycloak:keycloak-core:21.1.1
org.keycloak:keycloak-model-legacy:21.1.1
org.keycloak:keycloak-model-legacy-private:21.1.1
The issue is that the code for the external library is not included into the jar. What is the best approach to include the implementation into the jar?
// list of the dependencies needs to be included in the fat jar
include(dependency(âcom.xxxxx:$Versionâ))
}
}
docker file
in the gradlew command added the shadowJar
and copied the xxxxx-all.jar file to the binaries of the keycloak with the name xxxxx.jar in order to have the jar with the same name with the custom provider.
Any update here ? I am getting this error : Uncaught server error: java.lang.NoClassDefFoundError: com/messagebird/MessageBirdService.I created this file based on taniaâs comment not working. help help help, messagebird 6.1.2 and keycloak 22.0.5
my gradle :
My case was about a custom provider. I have created a folder called keycloak/provider-binaries and I put my generated jar there. Whatever I have into this folder I put into /opt/keycloak/providers/
If you dont have the correct jar into the /opt/keycloak/providers/, keycloak wonât find the right packages