Schema Registry Could Not Be Started

Hello.

I have build Schema Registry from github sources, trying to start and got

[2023-11-13 19:39:49,099] INFO Adding listener with HTTP/2: NamedURI{uri=http://0.0.0.0:8081, name='null'} (io.confluent.rest.ApplicationServer:307)
[2023-11-13 19:39:49,314] ERROR Server died unexpectedly:  (io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain:55)
org.apache.kafka.common.KafkaException: Class io.confluent.dekregistry.DekRegistryResourceExtension cannot be found
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:392)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:483)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:461)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:447)
	at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.<init>(KafkaSchemaRegistry.java:174)
	at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.initSchemaRegistry(SchemaRegistryRestApplication.java:73)
	at io.confluent.kafka.schemaregistry.rest.SchemaRegistryRestApplication.configureBaseApplication(SchemaRegistryRestApplication.java:103)
	at io.confluent.rest.Application.configureHandler(Application.java:324)
	at io.confluent.rest.ApplicationServer.doStart(ApplicationServer.java:212)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
	at io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain.main(SchemaRegistryMain.java:44)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: io.confluent.dekregistry.DekRegistryResourceExtension
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:425)
	at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:414)
	at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:390)

Can someone help with solution?

As I see, the problem is with Install and Configure the Schema Registry Security Plugin | Confluent Documentation ?

There is a difference between docs and code lines

# resource.extension.class=io.confluent.dekregistry.DekRegistryResourceExtension
resource.extension.class=io.confluent.kafka.schemaregistry.security.SchemaRegistrySecurityResourceExtension

Another attempt. I see the file

dek-registry/src/main/java/io/confluent/dekregistry/DekRegistryResourceExtension.java

trying to

cd dek-registry
mvn compile

gives an error

[ERROR] Could not find resource 'findbugs/findbugs-exclude.xml'. -> [Help 1]

What can be a solution?

What branch are you trying to build and how are you building? I ran mvn package followed by ./bin/schema-registry-start config/schema-registry.properties and Schema Registry started up without error. I built the 7.5.1-post branch for speed since the 7.5.1 common and rest-utils dependencies mentioned here are publicly available. For a more recent branch you’d need to check out the corresponding branches of those repos and build / install the dependencies.

My mistake - I really should have been on 7.5.2-post since 7.5.2 is the latest Confluent Platform release and therefore the latest published dependency version on packages.confluent.io (e.g., see rest-utils-parent, which Schema Registry depends on). Think of -post as the latest hotfixed 7.5.2 picture of Schema Registry.

The other later tags are all pre-release, which you could probably also use if you want (or be on the master branch of all), but again keep in mind you’d have to locally build and install Common and Rest Utils first.

The post branch is the post-release branch that might get compatibility fixes (e.g., say packages.confluent.io repository URL changed) but is otherwise pretty stable.

The tags are incremental builds.

master is the bleeding edge.

I would think that you’d either want to be closer to stable in which case you’d build from the -post branch, or on the bleeding edge; i.e., I can’t think of a use case for building from one of the tags. You’d have to have a good / informed reason to be doing that as opposed to master.

My suggestion, if you’re not looking to fork or contribute any code, just download Confluent Platform and run only the schema registry script. You can optionally remove extra packages and scripts, then redistribute the package within some internal repository / package manager. This way, there won’t be any JDK compilation differences between your system and Confluent’s build servers.

Docker images would also suffice for running the registry on its own.

When I have tried to build from 7.5.2-post branch, I got an error

69.17 FAILURE: Build failed with an exception.
69.17 
69.17 
69.17 Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
69.17 * What went wrong:
69.17 Execution failed for task ':connect:signMavenJavaPublication'.
69.17 > Cannot perform signing task ':connect:signMavenJavaPublication' because it has no configured signatory
69.17 
69.17 * Try:
69.17 > Run with --stacktrace option to get the stack trace.
69.17 > Run with --info or --debug option to get more log output.
69.17 > Run with --scan to get full insights.
69.17 > Get more help at https://help.gradle.org.
69.17 
69.17 You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
69.17 
69.17 For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
69.17 BUILD FAILED in 1m 8s
69.17 
69.17 80 actionable tasks: 80 executed
------
failed to solve: process "/bin/sh -c /home/engineer/.sdkman/candidates/gradle/current/bin/gradle     --no-daemon     --exclude-task test       jar install releaseTarGz" did not complete successfully: exit code: 1

When I am building from v7.5.3-2.css, all is fine.

Maybe, I must customize build script to build properly from the post branch?

Can you, please, suggest, can I use Maven to get latest build of Schema Registry with all necessary dependencies?