Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError when test produces no error #98

Open
rnveach opened this issue Nov 6, 2016 · 5 comments
Open

NoClassDefFoundError when test produces no error #98

rnveach opened this issue Nov 6, 2016 · 5 comments
Labels

Comments

@rnveach
Copy link

rnveach commented Nov 6, 2016

This is the issue specified in #97

When trying to work on the following PR: checkstyle/checkstyle#3517
Nondex failed in our CI with a weird error: https://travis-ci.org/checkstyle/checkstyle/jobs/173511656#L2063-L2066

testProcessJavadocWithLinkTag(com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheckTest)  Time elapsed: 0.018 sec  <<< ERROR!
java.lang.Error: Error was thrown while processing /home/travis/build/checkstyle/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/InputUnusedImportWithValueTag.java
	at com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheckTest.testProcessJavadocWithLinkTag(UnusedImportsCheckTest.java:111)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.puppycrawl.tools.checkstyle.utils.JavadocUtils
	at com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheckTest.testProcessJavadocWithLinkTag(UnusedImportsCheckTest.java:111)

The error is weird, because we have another CI that just runs the tests by themselves and they pass fine and the class in question was not modified in the PR. We can not reproduce the error locally or on some new CI runs.
We have been using nondex for a while and our master branch is passing.

@alexgyori
Copy link
Member

alexgyori commented Nov 6, 2016

Form my investigation it seems that even just rerunning the same code on Travis doesn't cause the failure anymore. It's not only that I can't reproduce it on my local machine, but even on Travis if I try the same build it doesn't fail anymore, right?

Basically, rerunning NonDex will not fail anymore. Is that correct?

@alexgyori alexgyori added the bug label Nov 6, 2016
@alexgyori
Copy link
Member

I ran the same code on Travis, and it seems it doesn't fail. It's very weird as I cannot reproduce it: https://travis-ci.org/alexgyori/checkstyle/jobs/173704238#L4989

@rnveach
Copy link
Author

rnveach commented Nov 7, 2016

Basically, rerunning NonDex will not fail anymore. Is that correct?

That is true so far. We haven't seen the issue again.

When it did happen, re-running the job did produce the same result, so it might be something related to its specific build.

Build image provisioning date and time
Thu Feb  5 15:09:33 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
Linux Version
3.13.0-29-generic
$ jdk_switcher use oraclejdk8
Switching to Oracle JDK8 (java-8-oracle), JAVA_HOME will be set to /usr/lib/jvm/java-8-oracle
cache.1
$ java -Xmx32m -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_31

@rnveach
Copy link
Author

rnveach commented Jan 26, 2017

We are having the same issue again in another PR.

PR: checkstyle/checkstyle#3756
CI: https://travis-ci.org/checkstyle/checkstyle/jobs/195323615#L1807-L1808

Same class that is failing to instantiate, JavadocUtils. Again, no errors locally.
I haven't been able to reproduce it in a separate CI run.

@rnveach
Copy link
Author

rnveach commented Mar 20, 2017

We got the issue again.

PR: checkstyle/checkstyle#4060
CI: https://travis-ci.org/checkstyle/checkstyle/jobs/212737548#L1190-L1193

Is there any word on finding what is causing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants