nodef found org.apache.kafka.common.serialization.stringserializer
Exception when you are trying to deploy a Kafka Producer/Consumer application as a jar.
I encountered this error while I was writing: Keycloak: Event Listener SPI & Publish to Kafka
Example code Producer.java#L41
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
To resolve this issue. Make your assembly to add the dependency while building the Jar.
<!-- Maven Assembly Plugin -->
If still, you see the issue. Try adding
Thank you for reading it. I was able to resolve it by adding the maven assembly plugin. Hope this was useful.