# Uncaught server error: java.lang.NoClassDefFoundError implementing a custom provider for an external mysql database

**URL:** <https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-implementing-a-custom-provider-for-an-external-mysql-database/22142>\
**Category:** Getting advice\
**Tags:** authentication\
**Created:** [May 16, 2023, 10:16am UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-implementing-a-custom-provider-for-an-external-mysql-database/22142 "2023-05-16T10:16:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tania](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/tania/32/9460_2.png) [@tania](https://forum.keycloak.org/u/tania)\
**Post date:** [May 18, 2023, 9:24am UTC](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-implementing-a-custom-provider-for-an-external-mysql-database/22142/3 "2023-05-18T09:24:43Z")

</div>

I leave the solution i had with gradle 7.4.0 and keycloak version 21.1.1

build.gradle  
plugins {  
id(“com.github.johnrengelman.shadow”) version “7.1.2”  
}

apply plugin: ‘com.github.johnrengelman.shadow’

shadowJar {

```
dependencies {

```

// 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.

Thank you for your responses.

---

_[View the full topic](https://forum.keycloak.org/t/uncaught-server-error-java-lang-noclassdeffounderror-implementing-a-custom-provider-for-an-external-mysql-database/22142)._
