nodef found org.apache.kafka.common.serialization.stringserializer

Exception when you are trying to deploy a Kafka Producer/Consumer application as a jar.


Example code

Here I defined the StringSerialized.class as a property for the Kafka Producer configuration.

This application is deployed as a jar to the Keycloak Server (SPI). The package is imported into the class. But, it failed to get resolved during the runtime.

The hacky solution is to reset the current thread context



isn’t recommended. Playing with classloader can cause unpredictable issues


<!-- Maven Assembly Plugin -->

If still, you see the issue. Try adding





Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store