confluentinc / cp-docker-images

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

Kafka Connect fails with NoSuchMethodError #360

Open smifun opened 6 years ago

smifun commented 6 years ago

After Upgrading Kafka Connect to 3.3.0 I'm getting this stacktrace

2017-10-12T08:55:58.024182000Z org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/usr/bin/../share/java/confluent-support-metrics/*]
2017-10-12T08:55:58.024430000Z either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
2017-10-12T08:55:58.024664000Z  at org.reflections.vfs.Vfs.fromURL(Vfs.java:109)
2017-10-12T08:55:58.024842000Z  at org.reflections.vfs.Vfs.fromURL(Vfs.java:91)
2017-10-12T08:55:58.025043000Z  at org.reflections.Reflections.scan(Reflections.java:240)
2017-10-12T08:55:58.025212000Z  at org.reflections.Reflections.scan(Reflections.java:202)
2017-10-12T08:55:58.025389000Z  at org.reflections.Reflections.<init>(Reflections.java:123)
2017-10-12T08:55:58.025719000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:221)
2017-10-12T08:55:58.025890000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:198)
2017-10-12T08:55:58.026089000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:159)
2017-10-12T08:55:58.026251000Z  at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:47)
2017-10-12T08:55:58.026402000Z  at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:63)
2017-10-12T08:56:10.624996000Z [2017-10-12 08:56:10,624] INFO Reflections took 41286 ms to scan 505 urls, producing 16433 keys and 125575 values  (org.reflections.Reflections)
2017-10-12T08:56:10.782350000Z Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
2017-10-12T08:56:10.782670000Z  at org.reflections.Reflections.expandSuperTypes(Reflections.java:380)
2017-10-12T08:56:10.782906000Z  at org.reflections.Reflections.<init>(Reflections.java:126)
2017-10-12T08:56:10.783122000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:221)
2017-10-12T08:56:10.787080000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:198)
2017-10-12T08:56:10.787262000Z  at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:159)
2017-10-12T08:56:10.787421000Z  at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:47)

Looks like guava dependency issue.

Fobhep commented 6 years ago

@smifun did you managed to resolve this? I am currently running into a similar problem

kccheung commented 6 years ago

@smifun did you managed to resolve this? I am currently running into the same problem as well.

kkonstantine commented 6 years ago

This is usually caused by adding an older version of guava earlier in the classpath. Connect framework (specifically org.reflections) required a more recent one - the one that ships as a dependency with AK (>= 20.0)

Can you imaging why this might be happening? Is a connector bringing an older guava earlier?

This will become easier to avoid when plugin.path is enabled by default for Confluent Platform (and its images) in 4.0.0