Open dylanmei opened 5 years ago
I am seeing the same error on 5.1.2. However, even removing that jar I still get the error. Any ideas on this?
I have similar error on 5.1.3 and 5.2.1 Following the above error I have also
java.lang.NoClassDefFoundError: Could not initialize class io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProviderFactory
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.configureRestService(CachedSchemaRegistryClient.java:107)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:92)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:79)
Update: I solved this problem by deleting the dependency "kafka-schema-registry-client" from my custom connector, and also explicitly excluded it from kafka-avro-serializer and kafka-connect-avro-converter as following
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-avro-converter</artifactId>
<version>${confluent.version}</version>
<exclusions>
<exclusion>
<artifactId>kafka-schema-registry-client</artifactId>
<groupId>io.confluent</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>${confluent.version}</version>
<exclusions>
<exclusion>
<artifactId>kafka-schema-registry-client</artifactId>
<groupId>io.confluent</groupId>
</exclusion>
</exclusions>
</dependency>
Hope this helps @rchady
I also see the errors
java.util.ServiceConfigurationError: io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProvider: Provider io.confluent.kafka.schemaregistry.client.security.basicauth.SaslBasicAuthCredentialProvider not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProviderFactory.<clinit>(BasicAuthCredentialProviderFactory.java:30)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.configureRestService(CachedSchemaRegistryClient.java:107)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:92)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:79)
and
java.lang.NoClassDefFoundError: Could not initialize class io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProviderFactory
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.configureRestService(CachedSchemaRegistryClient.java:107)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:92)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.<init>(CachedSchemaRegistryClient.java:79)
on my Kafka Connect cluster, similar to what @dylanmei experienced. I'm running the Docker image confluentinc/cp-kafka-connect:5.1.2, so the trick with excluding a Maven dependency doesn't work. Restarting the connectors does not resolve the issue, neither does restarting the Docker container. Any idea how to resolve and prevent it?
When following these instructions and adding any kind of
basic.auth.credentials.source
to an Key or Value Converter I trigger aServiceLoader
failure that occurs inBasicAuthCredentialProviderFactory
when launching a conector (S3 in my case):I get the same results when I use any of the
URL
,USER_INFO
, orSASL_INHERIT
options. I can reproduce with these steps:echo "hello" | kafkacat -b localhost:9092 -t connect-test -P
-- it doesn't matter that this isn't Avro; we never get that farcurl -XPOST -H "Content-Type: application/json" http://localhost:8083/connectors -d @connector-config.json
-- it doesn't matter whether you have valid AWS credentials, we never get that farconector-config.json
docker-compose.yml
I've tried many variations on
plugin.path
, trying to cleanup the CLASSPATH, removing every other connector, and so on. The only way I get this to work is by deleting this jar/usr/share/java/kafka-connect-storage-common/kafka-schema-registry-client-5.1.1.jar
which seems to conflict with the many other versions of this jar on the CLASSPATH.