jcustenborder / kafka-connect-solr

Kafka Connect connector for writing to Solr.
Apache License 2.0
43 stars 28 forks source link

Cannot start kafka-connect process due to "java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory" #42

Open ttrading opened 4 years ago

ttrading commented 4 years ago

I am running this on CentOS8. Kafka, zookeeper, Kafka-Connect and Solr are running on the same server.

Following is the terminal output: execution error.txt

My plugin path defined in /usr/local/kafka-connect/connect-standalone.properties is: plugin.path=/usr/local/kafka-connect,/usr/local/kafka/libs,/usr/share/java

Here is all the jar files after compilation:

[root@solr lib]# pwd /usr/local/kafka-connect/kafka-connect-solr/jcustenborder-kafka-connect-solr-0.1-SNAPSHOT/lib [root@solr lib]# ls checker-qual-2.10.0.jar httpclient-4.5.6.jar jetty-io-9.4.19.v20190610.jar commons-io-2.5.jar httpcore-4.4.10.jar jetty-util-9.4.19.v20190610.jar commons-math3-3.6.1.jar httpmime-4.5.6.jar jsr305-3.0.2.jar connect-utils-0.4.164.jar j2objc-annotations-1.3.jar kafka-connect-solr-0.1-SNAPSHOT.jar error_prone_annotations-2.3.4.jar jackson-annotations-2.11.2.jar listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar failureaccess-1.0.1.jar jackson-core-2.11.2.jar reflections-0.9.11.jar freemarker-2.3.28.jar jackson-databind-2.11.2.jar solr-solrj-8.2.0.jar guava-28.2-jre.jar javassist-3.21.0-GA.jar stax2-api-3.1.4.jar http2-client-9.4.19.v20190610.jar jetty-alpn-client-9.4.19.v20190610.jar woodstox-core-asl-4.4.1.jar http2-common-9.4.19.v20190610.jar jetty-alpn-java-client-9.4.19.v20190610.jar zookeeper-3.5.5.jar http2-hpack-9.4.19.v20190610.jar jetty-client-9.4.19.v20190610.jar zookeeper-jute-3.5.5.jar http2-http-client-transport-9.4.19.v20190610.jar jetty-http-9.4.19.v20190610.jar [root@solr lib]#

It is a standalone system. I built solr for testing purposes. Here is my properties file:

[root@solr etc]# cat httpsolr.properties

name=connsolr topics=conn tasks.max=1 connector.class=com.github.jcustenborder.kafka.connect.solr.HttpSolrSinkConnector solr.url=http://solr:8983/solr/lsl_conn solr.topic=lsl_conn solr.core.name=lsl_conn transforms=prune,key,cast transforms.prune.type=org.apache.kafka.connect.transforms.ReplaceField$Value transforms.prune.whitelist=CreatedAt,Id,Text,Source,Truncated transforms.key.type=org.apache.kafka.connect.transforms.ExtractField$Key transforms.key.field=Id transforms.cast.type=org.apache.kafka.connect.transforms.Cast$Key transforms.cast.spec=string [root@solr etc]# ^C [root@solr etc]# pwd /usr/local/kafka-connect/kafka-connect-solr/jcustenborder-kafka-connect-solr-0.1-SNAPSHOT/etc

Am I missing something here? Do I need all the attributes for my setup? It is not a cluster. Do I need these "transforms" or "solr.topic"?

jcustenborder commented 4 years ago

@ttrading What version of Kafka Connect are you running?

ttrading commented 4 years ago

I compiled it from the github site. I suppose it is the latest. jcustenborder-kafka-connect-solr-0.1-SNAPSHOT

jcustenborder commented 4 years ago

@ttrading Sorry not kafka-connect-solr but the kafka-connect-runtime it's self.

ttrading commented 4 years ago

Latest Kafka: kafka_2.13-2.6.0.tgz

I hope this answers your question.

jcustenborder commented 4 years ago

Yep that is what I was looking for. Thanks!

ttrading commented 4 years ago

Hello Jeremy. I was wondering if you had a chance to spend any time on this issue. Do you think I need to use another version of Kafka?

amladenovic commented 3 years ago

@ttrading Until it gets fixed, you can add in folder lib missing jar: org.apache.commons.logging-1.1.1.jar

ilosamart commented 3 years ago

This happens for Cloudera's distribution of Kafka Connect too. Our solution was add commons-loggin-1.2.jar into the sink's folder.