classcastexception/javax/ws/rs/ext/RuntimeDelegate.class

When I run the streams application, I get this exception,

java.lang.LinkageError: ClassCastException: attempting to castjar:file:/Users/k001/kafkastreams-poworkflowjsonprocessing-avro/target/kafkastreams-poworkflowjsonprocessing-avro-1.0-standalone.jar!/javax/ws/rs/ext/RuntimeDelegate.class to jar:file:/Users/k001/kafkastreams-poworkflowjsonprocessing-avro/target/kafkastreams-poworkflowjsonprocessing-avro-1.0-standalone.jar!/javax/ws/rs/ext/RuntimeDelegate.class
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:149)
	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:121)
	at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:96)
	at javax.ws.rs.core.UriBuilder.fromPath(UriBuilder.java:149)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:713)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:699)
	at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaByIdFromRegistry(CachedSchemaRegistryClient.java:224)
	at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaBySubjectAndId(CachedSchemaRegistryClient.java:298)
	at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaById(CachedSchemaRegistryClient.java:283)
	at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer$DeserializationContext.schemaFromRegistry(AbstractKafkaAvroDeserializer.java:307)
	at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:107)
	at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:86)
	at io.confluent.kafka.serializers.KafkaAvroDeserializer.deserialize(KafkaAvroDeserializer.java:55)
	at io.confluent.kafka.streams.serdes.avro.SpecificAvroDeserializer.deserialize(SpecificAvroDeserializer.java:66)
	at io.confluent.kafka.streams.serdes.avro.SpecificAvroDeserializer.deserialize(SpecificAvroDeserializer.java:38)
	at org.apache.kafka.common.serialization.Deserializer.deserialize(Deserializer.java:60)
	at org.apache.kafka.streams.processor.internals.SourceNode.deserializeValue(SourceNode.java:58)
	at org.apache.kafka.streams.processor.internals.RecordDeserializer.deserialize(RecordDeserializer.java:66)
	at org.apache.kafka.streams.processor.internals.RecordQueue.updateHead(RecordQueue.java:176)
	at org.apache.kafka.streams.processor.internals.RecordQueue.addRawRecords(RecordQueue.java:112)
	at org.apache.kafka.streams.processor.internals.PartitionGroup.addRawRecords(PartitionGroup.java:185)
	at org.apache.kafka.streams.processor.internals.StreamTask.addRecords(StreamTask.java:957)
	at org.apache.kafka.streams.processor.internals.TaskManager.addRecordsToTasks(TaskManager.java:1009)
	at org.apache.kafka.streams.processor.internals.StreamThread.pollPhase(StreamThread.java:907)
	at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:720)
	at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:583)
	at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:556)

Seems your CLASSPATH is not setup correctly and that you need to include some missing jars.

There were two jars that contained the same jar file. I removed one of the maven dependencies “jakarta” jar and issue went away