castorm / kafka-connect-http

Kafka Connect connector that enables Change Data Capture from JSON/HTTP APIs into Kafka.
https://castorm.github.io/kafka-connect-http/
Apache License 2.0
125 stars 56 forks source link

java.lang.NoClassDefFoundError: freemarker/template/Configuration #220

Open saurabhrawat opened 2 years ago

saurabhrawat commented 2 years ago

I am getting following error while starting my source connector:

[2022-03-14 09:48:10,669] INFO [http-source|task-0] TemplateHttpRequestFactoryConfig values: http.request.body = http.request.headers = Accept:application/json http.request.method = GET http.request.params = http.request.template.factory = class com.github.castorm.kafka.connect.http.request.template.freemarker.BackwardsCompatibleFreeMarkerTemplateFactory http.request.url = http://localhost:8080/api/messages (com.github.castorm.kafka.connect.http.request.template.TemplateHttpRequestFactoryConfig:376) [2022-03-14 09:48:10,671] ERROR [http-source|task-0] WorkerSourceTask{id=http-source-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:195) java.lang.NoClassDefFoundError: freemarker/template/Configuration at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) at java.lang.Class.getConstructor0(Class.java:3075) at java.lang.Class.getDeclaredConstructor(Class.java:2178) at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:390) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:399) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:434) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:419) at com.github.castorm.kafka.connect.http.request.template.TemplateHttpRequestFactoryConfig.(TemplateHttpRequestFactoryConfig.java:66) at com.github.castorm.kafka.connect.http.request.template.TemplateHttpRequestFactory.configure(TemplateHttpRequestFactory.java:48) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:405) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:434) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:419) at com.github.castorm.kafka.connect.http.HttpSourceConnectorConfig.(HttpSourceConnectorConfig.java:71) at com.github.castorm.kafka.connect.http.HttpSourceTask.start(HttpSourceTask.java:86) at org.apache.kafka.connect.runtime.WorkerSourceTask.initializeAndStart(WorkerSourceTask.java:225) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:186) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:243) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: freemarker.template.Configuration at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:103) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 23 more [2022-03-14 09:48:10,675] INFO [http-source|task-0] [Producer clientId=connector-producer-http-source-0] Closing the Kafka producer with timeoutMillis = 30000 ms. (org.apache.kafka.clients.producer.KafkaProducer:1208)

My Source connector properties are:

name=http-source kafka.topic=http-messages connector.class=com.github.castorm.kafka.connect.http.HttpSourceConnector http.request.url=http://localhost:8080/api/messages http.request.headers=Accept:application/json http.timer.interval.millis=30000

I am using following version:

castorm-kafka-connect-http-0.8.11

I can also see freemarker-2.3.31.jar in my libraries with others: image

Environment Details: OS - Windows10 Java 1.8 Confluent version - 7.0.1 (standalone) Http connector version - v0.8.11

ZPetrovich commented 1 year ago

Same issue! OS - Linux 36c83fe51c20 5.10.76-linuxkit Java - openjdk version "1.8.0_131 Confluent OSS v3.3.0 - Kafka v0.11.0.0 Http connector version - castorm-kafka-connect-http-0.8.11