question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] ClassNotFoundException on kafka-connect startup

See original GitHub issue

I was playing around with Kafka Connect and created a small sample project that setups all needed services + Kafka Connect using Docker Compose. All services start, but logs of kafka-connect are bothering me. I see a lot of ClassNotFoundException when it loads plugins. I did not configure neither CONNECT_PLUGIN_PATH, nor CLASSPATH, did not add volumes with additional plugins, so I supposed that it should work out of the box without these vars. Here is the whole startup log.

Could someone advise what is incorrect in my setup?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
puneetloyacommented, Jun 9, 2018

I had a similar experience using kafka-connect docker image but with kubernetes.

kind: Deployment
metadata:
  name: {{ template "kafka.fullname" . }}-connect
  labels:
    app: {{ include "kafka.name" . | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
spec:
  selector:
    matchLabels:
      app: {{ include "kafka.name" . | quote }}
  template:
    metadata:
      labels:
        app: {{ include "kafka.name" . | quote }}
    spec:
      containers:
      - name: kafka-connect
        image: confluentinc/cp-kafka-connect:4.1.1-1
        env:
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: {{ .Values.yyy }}
              key: S3_ACCESS_KEY
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: {{ .Values.xxx }}
              key: S3_SECRET
        - name: COMPONENT
          value: "kafka-connect"
        - name: CONNECT_BOOTSTRAP_SERVERS
          value: {{ template "kafka.fullname" . }}-headless:9092
        - name: CONNECT_SASL_MECHANISM
          value: "PLAIN"
        - name: CONNECT_SECURITY_PROTOCOL
          value: "SASL_PLAINTEXT"
        - name: CONNECT_GROUP_ID
          value: "kafka-connect"
        - name: CONNECT_CONFIG_STORAGE_TOPIC
          value: "connect-configs"
        - name: CONNECT_OFFSET_STORAGE_TOPIC
          value: "connect-offsets"
        - name: CONNECT_STATUS_STORAGE_TOPIC
          value: "connect-status"
        - name: CONNECT_KEY_CONVERTER
          value: "io.confluent.connect.avro.AvroConverter"
        - name: CONNECT_VALUE_CONVERTER
          value: "io.confluent.connect.avro.AvroConverter"
        - name: CONNECT_INTERNAL_KEY_CONVERTER
          value: "org.apache.kafka.connect.json.JsonConverter"
        - name: CONNECT_INTERNAL_VALUE_CONVERTER
          value: "org.apache.kafka.connect.json.JsonConverter"
        - name: CONNECT_REST_ADVERTISED_HOST_NAME
          value: {{ template "kafka.fullname" . }}-connect
        - name: CONNECT_STORE_URL
          value: {{ .Values.connect.s3.endpoint }}
        - name: CONNECT_S3_BUCKET_NAME
          value: {{ .Values.connect.s3.bucket }}
        - name: CONNECT_TOPICS
          value: "organization_ingress_throughput"
        - name: CONNECT_TASKS_MAX
          value: "1"
        - name: CONNECT_SCHEMA_COMPATIBILITY
          value: "NONE"
        - name: CONNECT_CONNECTOR_CLASS
          value: "io.confluent.connect.s3.S3SinkConnector"
        - name: CONNECT_STORAGE_CLASS
          value: "io.confluent.connect.s3.storage.S3Storage"
        - name: CONNECT_FORMAT_CLASS
          value: "io.confluent.connect.s3.format.json.JsonFormat"
        - name: CONNECTOR_NAME
          value: "s3-sink"
        - name: CONNECT_LOG4J_ROOT_LOGLEVEL
          value: "DEBUG"
        # - name: CONNECT_LOG4J_LOGGERS
        #   value: "org.reflections=ERROR"
        - name: CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL
          value: "http://localhost:8081"
        - name: CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL
          value: "http://localhost:8081"
        - name: CONNECT_PLUGIN_PATH
          value: "/usr/share/java,/etc/kafka-connect/jars" 
        - name: EXTRA_ARGS
          value: "-Djava.security.auth.login.config=client.jaas.conf"

The log is here: https://gist.github.com/puneetloya/33c7d66865892513c7b7d01a01cc2cfa

0reactions
liangrycommented, Jan 22, 2019

I solved the problem with the tips: http://mail-archives.apache.org/mod_mbox/kafka-users/201707.mbox/<CABqDk2NgWS0faAyYKdXGs4t=wdPverYHr8rjBP4W11vGueY+5w@mail.gmail.com>

If you are running kafka connect with docker image, add this config to /etc/confluent/docker/log4j.properties.template:

log4j.logger.org.reflections=ERROR

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve the classNotFoundException warnings when ...
Here's an example Docker Compose that you can use which shows installing a Kafka Connect connector too: github.com/confluentinc/demo-scene/blob/ ...
Read more >
Why do I get java.lang.NoClassDefFoundError when updating ...
Problem Description. When the Aerospike Kafka Inbound Connector is updated to version 2.2 or higher, the update fails with the following error.
Read more >
java.lang.ClassNotFoundException: io.debezium.util.IoUtil error
Due to constraint configuration problems the provider org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource will be ignored.
Read more >
Problem with writing Kafka Connect `log4j` logs to a Kafka Topic
I need to write Kafka Connect log4j logs to a Kafka Topic, to be able to access ... Usually, there is much more...
Read more >
kafka-connect-sap error confluent - SAP Community
Hi all, I am using kafka-connect-sap available ... Error while starting connector (org.apache.kafka.connect.runtime.WorkerConnector:193).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found