java.lang.NoClassDefFoundError when updating Inbound Kafka Connector

java.lang.NoClassDefFoundError when updating Inbound Kafka Connector

Problem Description

When the Aerospike Kafka Inbound Connector is updated to version 2.2 or higher, the update fails with the following error:

java.lang.NoClassDefFoundError:
io/confluent/kafka/schemaregistry/client/SchemaRegistryClient
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:720)
at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:475)
at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:468)
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:108)
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:129)

The class exists on the system.

Explanation

From version 2.2 of the Inbound Connector the Avro converter was removed from the release. The converter had previously been present in the release artifact but was an unused dependency (unless if specified as a converter in the configuration). The Aerospike connector is converter agnostic as per convention. Any converter dependency should be setup external to the connector.

Solution

The JAR containing the AvroConverter needs to be available in one of the directories that is listed on the Connect worker’s plugin.path configuration properties.

Notes

Applies To

Kafka Connector 2.2 and later

Keywords

KAFKA CONNECTOR SINK INBOUND NO CLASS

Timestamp

November 2021

© 2021 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.