testng 7.1.0 java.lang.ClassNotFoundException: com.google.inject.Stage
See original GitHub issueTestNG Version
TestNG 7.1.0
Expected behavior
Actual behavior
the testng-remote integration test failed https://travis-ci.org/testng-team/testng-remote/jobs/481901771
[RemoteTestNG] revisions:
git.commit.id=32c8977
git.branch=32c8977911e409c8c8c2d4bce973e94d2acf5ca7
git.build.version=1.4.1-SNAPSHOT
[RemoteTestNG] loaded class org.testng.internal.Version at file:/home/travis/.groovy/grapes/org.testng/testng/jars/testng-7.1.0.jar
[RemoteTestNG] detected TestNG version 7.1.0
Caught: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.testng.internal.Configuration.<init>(Configuration.java:33)
at org.testng.TestNG.init(TestNG.java:216)
at org.testng.TestNG.<init>(TestNG.java:200)
at org.testng.remote.AbstractRemoteTestNG.<init>(AbstractRemoteTestNG.java:17)
at org.testng.remote.support.RemoteTestNG6_12.<init>(RemoteTestNG6_12.java:18)
at org.testng.remote.support.RemoteTestNGFactory6_12.createRemoteTestNG(RemoteTestNGFactory6_12.java:16)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:67)
at org.testng.remote.RemoteTestNG$main.call(Unknown Source)
at TestNGTest.run(TestNGTest.groovy:49)
Caused by: java.lang.NoClassDefFoundError: com/google/inject/Stage
... 9 more
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
... 9 more
[BaseMessageSender] Stopped receiver
Is the issue reproductible on runner?
- Shell
- Maven
- Gradle
- Ant
- Eclipse
- IntelliJ
- NetBeans
Test case sample
Please, share the test case (as small as possible) which shows the issue https://github.com/testng-team/testng-remote/blob/master/remote-test/src/test/groovy/Tester.groovy
Issue Analytics
- State:
- Created 4 years ago
- Comments:38 (7 by maintainers)
Top Results From Across the Web
TestNG 7.0.1 java.lang.ClassNotFoundException
[RemoteTestNG] detected TestNG version 7.0.1. Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage at org.testng.internal.
Read more >Exception in thread "main" java.lang.NoClassDefFoundError ...
Below is my stacktrace. Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage at org.testng.internal.
Read more >I have downloaded TestNG VERSION 7.0 AND WHEN i run as ...
I have downloaded TestNG VERSION 7.0 AND WHEN i run as testng i haven;t wrote any ... NoClassDefFoundError: com/google/inject/Stage".
Read more >How To Solve- org.testng.TestNGException - YouTube
Many people are facing issue because of the TestNG version and its compatibility issues. Here is the error log looks likeorg. testng.
Read more >#eclipse #test Exception in thread "main" java.lang ... - YouTube
lang. NoClassDefFoundError : com/google / inject / Stage.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Eclipse IDE for Java Developers, Version: 2019-12 (4.14.0), Build id: 20191212-1212. TestNG 7.1.0.r202001120626
Removing the TestNG library from the build path of the project containing the test and installing TestNG from menu Help / Install New Software did not work for me, I kept getting this error.
What worked for me was downloading guice-4.2.2.jar (from https://github.com/google/guice/wiki/Guice422), copying it into any folder, and adding it to the build path of the project as external JAR.
@missedone
In 7.0.0 pom below was the dependency information on guice
In 7.1.0 pom below was the dependency information on guice
So perhaps this issue is because guice became a compile time dependency from being a provided dependency ?