confluentinc / confluentinc/common-docker
java.lang.NoClassDefFoundError: org/apache/kafka/connect/errors/ConnectException on Secret Provider check in ensure script
- Dominant language
- Java
- Stars
- 10
- Forks
- 76
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 105
Description
Hi
I was trying to use the secret provider for Azure Key Vault from lenses.io
https://github.com/lensesio/secret-provider
https://github.com/lensesio/secret-provider/releases/tag/2.1.6
I added the jar file to the directory used
COPY secret-provider-2.1.6-all.jar /usr/share/java/cp-base-new/
When I start the container (confluentinc/cp-kafka-connect-base:latest) I get the following exception:
```
===> Check if Kafka is healthy ...
Using log4j config /etc/cp-base-new/log4j.properties
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/connect/errors/ConnectException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:419)
at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:408)
at org.apache.kafka.common.config.AbstractConfig.instantiateConfigProviders(AbstractConfig.java:577)
at org.apache.kafka.common.config.AbstractConfig.resolveConfigVariables(AbstractConfig.java:521)
at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:112)
at org.apache.kafka.common.config.AbstractConfig.(AbstractConfig.java:146)
at org.apache.kafka.clients.admin.AdminClientConfig.(AdminClientConfig.java:235)
at org.apache.kafka.clients.admin.Admin.create(Admin.java:144)
at org.apache.kafka.clients.admin.AdminClient.create(AdminClient.java:49)
at io.confluent.admin.utils.ClusterStatus.isKafkaReady(ClusterStatus.java:136)
at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:149)
Caused by: java.lang.ClassNotFoundException: org.apache.kafka.connect.errors.ConnectException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 13 more
```
When I add [connect-api-3.4.0.jar](https://repo1.maven.org/maven2/org/apache/kafka/connect-api/3.4.0/connect-api-3.4.0.jar) to the directory this exception does not occur.
Maybe this class was moved in the past, would probably be good to include the file by default.
Contributor guide
Research direction
Start by inspecting the ensure script and the dependency layout used by confluentinc/cp-kafka-connect-base:latest, then reproduce the failure with the Dockerfile's COPY of secret-provider-2.1.6-all.jar. Compare startup behavior with connect-api-3.4.0.jar present and verify that the Secret Provider check completes without NoClassDefFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, docker, java
- Domain
- cloud, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100