[
https://issues.apache.org/jira/browse/BEAM-5875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669371#comment-16669371
]
Luke Cwik commented on BEAM-5875:
---------------------------------
I posted this on the subsequent bug that Kenn cut (BEAM-5881) but relevant here:
You first compile your code using a dependency such as Guava. Then you can:
shade: use the shadow plugin to update your code to point to relocated code and
also package the relocated dependency within your jar not exporting it as a
dependency.
vendor: use the shadow plugin to update your code to point to relocated code
but not package the relocated dependency within your jar and instead point to
an artifact that already contains the relocated code
In general, you can run into this situation if either you don't package the
relocated dependency or declare a vendored dependency. In the case of
BEAM-5875, it looks like you don't include the relocated dependency since guava
isn't part of the compile scope:
https://github.com/apache/beam/blob/f20e90a65874945dbbeb33270cab2a91d619af03/sdks/java/testing/test-utils/build.gradle#L26
> Nexmark perf tests fail due to NoClassDefFoundError for Iterables.
> ------------------------------------------------------------------
>
> Key: BEAM-5875
> URL: https://issues.apache.org/jira/browse/BEAM-5875
> Project: Beam
> Issue Type: Bug
> Components: test-failures
> Reporter: Henning Rohde
> Assignee: Kenneth Knowles
> Priority: Critical
> Labels: currently-failing
> Time Spent: 2h
> Remaining Estimate: 0h
>
> https://scans.gradle.com/s/vjkiys2xc3age/console-log?task=:beam-sdks-java-nexmark:run
> I see:
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/beam/repackaged/beam_sdks_java_test_utils/com/google/common/collect/Iterables
> at
> org.apache.beam.sdk.testutils.metrics.MetricsReader.checkIfMetricResultIsUnique(MetricsReader.java:128)
> at
> org.apache.beam.sdk.testutils.metrics.MetricsReader.getCounterMetric(MetricsReader.java:65)
> at
> org.apache.beam.sdk.nexmark.NexmarkLauncher.currentPerf(NexmarkLauncher.java:250)
> at
> org.apache.beam.sdk.nexmark.NexmarkLauncher.monitor(NexmarkLauncher.java:435)
> at
> org.apache.beam.sdk.nexmark.NexmarkLauncher.run(NexmarkLauncher.java:1156)
> at org.apache.beam.sdk.nexmark.Main$Run.call(Main.java:108)
> at org.apache.beam.sdk.nexmark.Main$Run.call(Main.java:96)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:
> org.apache.beam.repackaged.beam_sdks_java_test_utils.com.google.common.collect.Iterables
> 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)
> ... 13 more
> PRs for the first red run:
> [BEAM-5716] Move nexmark to "testing" directory in java sdk (commit: 0074138)
> (detail / githubweb)
> [BEAM-5716] Move load-tests code to "testing" directory in java sdk (commit:
> 6674c9d) (detail / githubweb)
> [BEAM-5716] Create module for testing utils (commit: 0628951) (detail /
> githubweb)
> [BEAM-5716] Extract MetricReader class, test it and use in Nexmark code
> (commit: 69730fc) (detail / githubweb)
> [BEAM-5355] Use MetricsReader in GroupByKeyLoadTest (commit: 7374eb6) (detail
> / githubweb)
> Ćukasz -- would you mind taking a look? Looks like a shading issue.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)