[KAFKA-347] NoClassDefFoundError For CodecRegistryHelper Created: 13/Jan/23  Updated: 13/Jan/23  Resolved: 13/Jan/23

Status: Closed
Project: Kafka Connector
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Unknown
Reporter: Krishna Agrawal Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We are getting following error for both sink and source connector . we are using lastest version of connector 1.8.1

 

Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. Error: org/bson/internal/CodecRegistryHelper (org.apache.kafka.connect.runtime.WorkerSinkTask:616)
java.lang.NoClassDefFoundError: org/bson/internal/CodecRegistryHelper
at com.mongodb.client.internal.MongoClientImpl.<init>(MongoClientImpl.java:73)
at com.mongodb.client.internal.MongoClientImpl.<init>(MongoClientImpl.java:63)
at com.mongodb.client.MongoClients.create(MongoClients.java:108)
at com.mongodb.kafka.connect.sink.MongoSinkTask.getMongoClient(MongoSinkTask.java:193)
at com.mongodb.kafka.connect.sink.MongoSinkTask.bulkWriteBatch(MongoSinkTask.java:229)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at com.mongodb.kafka.connect.sink.MongoSinkTask.put(MongoSinkTask.java:131)
at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:584)
at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:334)
at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:235)
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:204)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:201)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:256)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829) 

 



 Comments   
Comment by Krishna Agrawal [ 13/Jan/23 ]

Thanks Ross,

After adding the uber dependency jar the issue is not fixed , I am closing the ticket. we have raised the same ticket to mongodb support team. now only issue is now the data is not syncing we will continue the discussion with support team.

Comment by Ross Lawley [ 13/Jan/23 ]

Hi krishna.agarwal@tui.co.uk,

Thank you for reaching out. A java.lang.NoClassDefFoundError indicates that you are missing required classes to use the Kafka connector. Its not clear how you have installed it or what flavour of Kafka you have but please review the installation documentation. It appears you are not using the uber jar and therefore have missing classes.

Let me know if that helps fix the issue for you. If not please provide information regarding how you have installed the connector and the build / environment you are using.

For future reference as this sounds like a support issue, I wanted to give you some resources to get this question answered more quickly:

  • Our MongoDB support portal, located at support.mongodb.com
  • Our MongoDB community portal, located here
  • If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI

Just in case you have already opened a support case and are not receiving sufficient help, please let me know and I can facilitate escalating your issue.

All the best,

Ross Lawley

Generated at Thu Feb 08 09:06:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.