-
Notifications
You must be signed in to change notification settings - Fork 1k
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
testng 7.1.0 java.lang.ClassNotFoundException: com.google.inject.Stage #2223
Comments
In 7.0.0 pom below was the dependency information on guice <dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.1.0</version>
<classifier>no_aop</classifier>
<scope>provided</scope>
</dependency> In 7.1.0 pom below was the dependency information on guice <dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.1.0</version>
<classifier>no_aop</classifier>
<scope>compile</scope>
</dependency> So perhaps this issue is because guice became a compile time dependency from being a provided dependency ? |
Doubtful. The dependency is harder now than it was before. Note that the error is |
Making |
It is api only though. If the |
Well, maven (i.e. BTW, what will happen, if I have |
Guice is compile time dependency: https://github.com/cbeust/testng/blob/master/src/main/java/org/testng/internal/Configuration.java#L33 so it's hard dependency the fix is either make Guice the compile dependency in pom manifest or make injectorFactory lazy init |
please remove the jar file from the build path and install TestNG from help menu(install software) |
Eclipse IDE for Java Developers, Version: 2019-12 (4.14.0), Build id: 20191212-1212. 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. |
Can you please provide me the link to install plugin from "Install new software" |
From Eclipse, Go to Help > Install software or You can install from market place as well (Help > Market Place). After installing TestNG from market place, it dint work, but installing the GUICE422.jar to the build path worked for me |
That is the only way that works for me as well, and the weirdest thing was TestNG version 7.0.1 was displayed in the console regardless of the TestNG version that I installed was 7.1.1. Anyway it works now. |
@krmahadevan We need this fix, when is the next release of TestNG? |
@yaminikb - The release should be out soon (in a week or so). |
JFI, my TestNG apparently has just updated, to 7.1.1.202003100345, but if I remove from the build path the Guice JAR that I had to add manually to avoid the NoClassDefFoundError, the error reappears. So for me today's update made zero difference, besides the fact that now I can't tell for sure which TestNG version I have: expanding the TestNG node in Package Explorer says 7.1.0.r202001120626 (which is the same I already had since long before today's update), and under C:\eclipse\plugins, besides the 7.1.0.* JARs that I already had, I now also have two 7.1.1.* JARs which, as I mentioned, don't seem to be used. |
The eclipse plugin update is not to fix this issue. Still need to wait for the new testng release . |
How to downgrade to version 7.0.? |
[RemoteTestNG] detected TestNG version 7.0.1 I faced this issue kindly advice.. |
@mlook172 , you can try to install the beta build in your eclipse: |
its working fine now thanks |
7.2.0.r202003151902 has fixed the issue, thank you! |
thanks a lot
|
Works for me as well. Thanks ! |
I also faced the same issue. Thank you. It's working for me now |
It did excuse the error. But all the test cases are skipping/ failing on introducing guice.jar |
@twinki1624 , could you try with my comment: testng-team/testng-eclipse#472 (comment) |
Unfortunately, it's still now working. Can you guide me through any other steps? I'm in the mid of a project, need it to be resolved at the earliest. |
@twinki1624 , for this DTD https url issue, pls update testng eclipse plugin to latest update site: https://dl.bintray.com/testng-team/testng-eclipse-release |
I tried it using the above link, help>install new software,it's not getting installed. |
Any movement on this? I'm seeing the same issue. Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage |
Your version is probably not up to date, the problem was fixed with 7.2.0.r202003151902 |
Install TestNG 7.1 and then install P2 libraries from TestNG 7.2 |
I'm also facing the same issue. I tried all the above solutions nothing worked for me [RemoteTestNG] detected TestNG version 7.0.0 I tried to match all the verion plugin and testng jar For testNG p2- i used this urlhttps://dl.bintray.com/testng-team/testng-p2-release/7.0.0/ Can someone please help me here |
It's not the same issue, you have a NoSuchMethodError, not a NoClassDefFoundError. Look up the causes of NoSuchMethodError. A JAR is found in your case but you probably have some version mismatch, maybe an old JAR. |
@SantiBailors thanks for your reply. I also, tried that, uninstalled the TestNG and reinstalled the latest version, it didnt work. then again i uninstalled the latest version an installed TestNG7.0.0 just to maintain same versions for jar file and plugin. Although I'm not sure if that should be the case, |
I don't know how it didn't work so it's difficult to say much, but if you mean that you got the NoSuchMethodError even from a clean reinstallation I would be surprised. Anyway, based on what is known, if it was me I would install another Eclipse in a separate folder (it won't interfere with the existing Eclipse installation), making sure it's the latest Eclipse, then install TestNG there, via marketplace. If it still gives the NoSuchMethodError it would be really strange. You could also try to uninstall TestNG, close Eclpise, delete from the Also note that from your stacktrace it's clear that that NoSuchMethodError has nothing to do with Guice or other external libraries, so you should really open a new issue, your problem is not linked with the one discussed in this thread. And maybe by giving a specific title to the new thread you can get more focused help. |
I already tried everything on brand new stuff, but once again i will try the same thing, may be I'm missing some key thing. Also, I copied my previous pom.xml file(dependencies only) in the new one, as it has many jars that are required in my project. may be that could be the reason too.. once again thank you @SantiBailors |
Removed TestNG jar file from the build path and add the following dependency to the POM. It worked for me. |
@SantiBailors0 You saved my day after wasting 3-4 hrs to find the right answer. Adding a dependency of GUICE4.2.2 is working like charm. Thanks man |
TestNG 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
Is the issue reproductible on runner?
Test case sample
The text was updated successfully, but these errors were encountered: