geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Lund <kl...@apache.org>
Subject geode-junit and geode-dunit classpath problems
Date Fri, 08 Feb 2019 22:01:00 GMT
We have a src/main class called UseJacksonForJsonPathRule which uses
classes from this dependency in geode-junit/build.gradle:

  compile('com.jayway.jsonpath:json-path')

I'm trying to write a unit test in src/test called
UseJacksonForJsonPathRuleTest but it fails with the following
NoClassDefFoundErrors. These are the same classes used by any test using
UseJacksonForJsonPathRule. geode-dunit's
DistributedUseJacksonForJsonPathRule extends UseJacksonForJsonPathRule and
we have one test in geode-core that uses the distributed version of the
rule and it passes without NoClassDefFoundErrors.

Anyone know why or what needs to change in geode-junit/build.gradle?

Also, I seem to keep hitting this ever since we exploded geode-junit and
geode-dunit. It's as if the classpaths aren't really correct for
geode-junit and geode-dunit, such that when I start writing unit tests or
integration tests within those two modules, they just don't work unless I
move the test to geode-core -- that's the only module in which I can
actually run these back filled unit tests. Given that it seems to be a
systemic problem with geode-junit and geode-dunit, can we do something to
fix this systemically instead of every single time I write a new test?

java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ObjectMapper

at
com.jayway.jsonpath.spi.json.JacksonJsonProvider.<clinit>(JacksonJsonProvider.java:32)
at
org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule$1.<init>(UseJacksonForJsonPathRule.java:65)
at
org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule.before(UseJacksonForJsonPathRule.java:63)
at
org.apache.geode.test.junit.rules.serializable.SerializableExternalResource.access$000(SerializableExternalResource.java:24)
at
org.apache.geode.test.junit.rules.serializable.SerializableExternalResource$1.evaluate(SerializableExternalResource.java:36)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException:
com.fasterxml.jackson.databind.ObjectMapper
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)
... 20 more


java.lang.NoClassDefFoundError: Could not initialize class
com.jayway.jsonpath.spi.json.JacksonJsonProvider

at
org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule$1.<init>(UseJacksonForJsonPathRule.java:65)
at
org.apache.geode.test.junit.rules.UseJacksonForJsonPathRule.before(UseJacksonForJsonPathRule.java:63)
at
org.apache.geode.test.junit.rules.serializable.SerializableExternalResource.access$000(SerializableExternalResource.java:24)
at
org.apache.geode.test.junit.rules.serializable.SerializableExternalResource$1.evaluate(SerializableExternalResource.java:36)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message