Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in KafkaAvroJavaProducerV1Demo #20

Closed
asarraf opened this issue Nov 10, 2023 · 0 comments
Closed

Exception in KafkaAvroJavaProducerV1Demo #20

asarraf opened this issue Nov 10, 2023 · 0 comments

Comments

@asarraf
Copy link
Contributor

asarraf commented Nov 10, 2023

https://github.com/simplesteph/kafka-avro-course/blob/c991400baaa62352a87255234f306a04d275e780/kafka-avro-v1/src/main/java/com/github/simplesteph/kafka/apps/v1/KafkaAvroJavaProducerV1Demo.java#L23C14-L23C14

This line results into the below exception:

Exception in thread "main" java.lang.NoClassDefFoundError: io/confluent/kafka/schemaregistry/client/rest/exceptions/RestClientException
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:735)
	at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:490)
	at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:483)
	at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:113)
	at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:133)
	at org.apache.kafka.clients.producer.ProducerConfig.<init>(ProducerConfig.java:553)
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:289)
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:316)
	at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:301)
	at com.example.KafkaAvroProducerV1.main(KafkaAvroProducerV1.java:23)
Caused by: java.lang.ClassNotFoundException: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 12 more

The way to resolve it is to not exclude kafka-schema-registry-client in the respective pom file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants