confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 705 forks source link

Lots of WARNING ReflectionsException & ClassNotFoundException logs thrown by confluentinc/cp-kafka-connect:5.0.1 container #638

Open dkirrane opened 5 years ago

dkirrane commented 5 years ago

I've deployed the cp-helm-chart to Kubernetes but the cp-kafka-connect-server container fills the logs with warnings like:

[2018-11-28 12:47:21,933] WARN could not get type for name org.osgi.framework.BundleListener from any class loader (org.reflections.Reflections)
org.reflections.ReflectionsException: could not get type for name org.osgi.framework.BundleListener
    at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:390)
    at org.reflections.Reflections.expandSuperTypes(Reflections.java:381)
    at org.reflections.Reflections.<init>(Reflections.java:126)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader$InternalReflections.<init>(DelegatingClassLoader.java:410)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:310)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:244)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:236)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:205)
    at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:182)
    at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:61)
    at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:74)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleListener
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:388)
    ... 10 more
jaredpetersen commented 5 years ago

I'm seeing this as well in the cp-kafka-connect-base image at tag 5.0.1. This was apparently fixed in the past by changing the default log4j properties for connect: https://issues.apache.org/jira/browse/KAFKA-5229

jaredpetersen commented 5 years ago

A fix for this is to add a new environment variable at runtime:

-e CONNECT_LOG4J_LOGGERS="org.apache.zookeeper=ERROR,org.I0Itec.zkclient=ERROR,org.reflections=ERROR"

I didn't come up with this myself though, it's also present in thecp-all-in-one docker compose example and in the Kafka source

I'm not sure why cp-kafka-connect-base isn't already using this configuration though.