While starting Schema Registry getting below Error

While starting Schema Registry through command line on RHEL getting below Error :
Error : unable to initialize main class io.confluent.kafka.schema registry.rest.schemaregistrymain caused by: java.lang.noclassdeffounderror: io/confluent/rest/restconfigexception

Hi @Sandisk and welcome!

Could you share repro instructions? It’ll help to know the steps you took including which version of Schema Registry you’re using.

Thanks for ur reply.

We r trying to install confluent 7.5 Enterprise addition on our organization RHEL with java 17.

We successfully started Kafka and zookeeper . But while starting Schema Registry, ksql and Kafka rest we r getting Same error NoClassDeFoundError.

Due to confidentiality I can’t share other info.
Our RHEL has some restriction so,

Can u please tell us what is the possible reason due to which this error occurred?

I installed Confluent Platform via systemd on RHEL by following these instructions and was able to start Kafka and Schema Registry. Try those instructions if you’re installing in another way.

It’s a classpath issue so if those instructions aren’t working for you, you’d want to double check that the expected jar is present on your system. RestConfigException comes from the rest-utils-<CP_VERSION>.jar. If you follow the linked instructions it would live at /usr/share/java/rest-utils/rest-utils-<CP_VERSION>.jar. If that file is present and readable by the cp-schema-registry user, double check that the command to start Schema Registry is constructing the classpath properly. Removing a bunch of other paths, it should contain the path to the REST Utils jar, i.e., ps output would show the command to start Schema Registry that looks like this:

java ... -cp :...:/usr/bin/../share/java/rest-utils/*:... 
io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain 
/etc/schema-registry/schema-registry.properties

Thanks @dtroiano for ur reply.
It’s working now.

1 Like