If I'm seeing > java.lang.NoClassDefFoundError...
# contributing-to-airbyte
m
If I'm seeing
java.lang.NoClassDefFoundError: com/google/common/collect/Streams
when running tests, what's the most likely culprit? Googling suggests that there's likely something missing from the classpath, but this error is being raised from core Airbyte code that I'm pulling in as a dependency, so it doesn't feel like my project should need something added to its classpath. On the other hand, I haven't touched those modules, and it doesn't seem as if other tests that depend on them have any trouble running, so the problem has to be in my project somewhere... right?
u
might help if you can put up your work so far in a draft PR.
u
also which gradle task is causing it?
u
u
It's caused by running
OracleIntegrationTest
from within the IDE; I'm not using Gradle for the tests.
u
when you run
Copy code
./gradlew :airbyte-integrations:connectors:destination-oracle:integrationTest
u
do you get the same error?
u
Yes:
Copy code
> Task :airbyte-integrations:connectors:destination-oracle:integrationTestJava

OracleIntegrationTest > testCheckConnectionInvalidCredentials() FAILED
    java.lang.NoClassDefFoundError: com/google/common/collect/Streams
        at io.airbyte.commons.string.Strings.join(Strings.java:33)
        at io.airbyte.validation.json.JsonSchemaValidator.test(JsonSchemaValidator.java:76)
        at io.airbyte.workers.protocols.airbyte.AirbyteProtocolPredicate.test(AirbyteProtocolPredicate.java:44)
        at io.airbyte.workers.protocols.airbyte.DefaultAirbyteStreamFactory.lambda$create$1(DefaultAirbyteStreamFactory.java:81)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812)
        at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
        at io.airbyte.workers.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:81)
        at io.airbyte.integrations.standardtest.destination.TestDestination.runCheck(TestDestination.java:800)
        at io.airbyte.integrations.standardtest.destination.TestDestination.testCheckConnectionInvalidCredentials(TestDestination.java:306)
... and so on
u
I'm assuming you've run a clean and then build?
u
Yeah, no difference
u
fwiw, i cannot reproduce this on my machine.
u
i pulled down your branch and ran the integration tests in intellij and in the cli and i'm not seeing anything fail with this class def issue.
u
🤦‍♂️
u
oh
u
wait.
u
you seeing it now?
u
yup
u
it was hidden. but i see it.
u
Great. Any idea what's causing it? 😛
u
my guess is that whatever version of guava the oracle dependency is using is conflicting with the verusion of guava we are using
u
guava == com/google/commons
u
though tbh, i'm not really seeing any weird version of guava in the dependencies
u
Copy code
./gradlew :airbyte-integrations:connectors:destination-oracle:dependencies | grep guava
u
weird
u
i might have a fix.
u
running 2 last tests.
u
yeah?
u
i just bumped the version of guava.
u
for the whole project?
u
yeah
u
i pushed a commit
u
in that dependecy graph from that command i was seeing 2 versions. 29.0 and 30.1.1
u
we declare 0.29.0
u
so i figured i'd just try to get everything to 30.1.1 and that seemed to work.
u
Sounds good