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

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage #472

Closed
Pawan1990 opened this issue Jan 15, 2020 · 25 comments

Comments

@Pawan1990
Copy link

Recently i have updated TestNG version 7.0.1 in Eclipse and while running the code i keep getting this error information :

[RemoteTestNG] detected TestNG version 7.0.1
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.testng.internal.Configuration.(Configuration.java:33)
at org.testng.TestNG.init(TestNG.java:216)
at org.testng.TestNG.(TestNG.java:200)
at org.testng.remote.AbstractRemoteTestNG.(AbstractRemoteTestNG.java:17)
at org.testng.remote.support.RemoteTestNG6_12.(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)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 7 more
Note- Before the TestNG 7.0.1 all the script was running fine but after updated of TestNG 7.0.1. i am getting above error. Please help me out.

@missedone
Copy link
Collaborator

i reported the issue here testng-team/testng#2223
we need to wait for the fix

@missedone
Copy link
Collaborator

closing this, fixed by upstream testng-team/testng#2264

@vrazhagunila
Copy link

I am new to TestNG. I am also getting this error. Please let me know how to resolve this one?
Below is my error message:

[RemoteTestNG] detected TestNG version 7.0.1
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.testng.internal.Configuration.(Configuration.java:33)
at org.testng.TestNG.init(TestNG.java:216)
at org.testng.TestNG.(TestNG.java:200)
at org.testng.remote.AbstractRemoteTestNG.(AbstractRemoteTestNG.java:17)
at org.testng.remote.support.RemoteTestNG6_12.(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)
Caused by: java.lang.NoClassDefFoundError: com/google/inject/Stage
... 7 more
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more

@missedone
Copy link
Collaborator

not sure how you manage the dependency in your project, but you can either downgrade to testng 7.0.0 or upgrade to 7.1.1-SNAPSHOT.

@vrazhagunila
Copy link

not sure how you manage the dependency in your project, but you can either downgrade to testng 7.0.0 or upgrade to 7.1.1-SNAPSHOT.

As i mentioned i am very new to this TestNG. I just added my plugin to Eclipse. I will try to do whatever you mentioned. Thank you so much for your response.

@vrazhagunila
Copy link

vrazhagunila commented Mar 11, 2020

not sure how you manage the dependency in your project, but you can either downgrade to testng 7.0.0 or upgrade to 7.1.1-SNAPSHOT.

Thanks for your Help. I downgraded my TestNg to 7.0.0. It working as expected.
Thanks again.

@missedone
Copy link
Collaborator

issue fixed. for people use "TestNG Library" in eclipse, pls update to testng 7.2.0 with following update site url: https://dl.bintray.com/testng-team/testng-p2-release/7.2.0/

@kiranattal
Copy link

@missedone : Thanks so much. Fixed the issue. Saved many hours :)

@missedone missedone mentioned this issue Apr 2, 2020
2 tasks
@Viraj6937
Copy link

Download the guice 4.2.2 Jar file to solve this issues and place that guice into project build path add it as external jars

@missedone
Copy link
Collaborator

@Viraj6937 , you don't need to download the jar yourself, it's been fixed, see my comment: #472 (comment)

@daksha1933
Copy link

Recently i have updated TestNG version 7.0.1 in Eclipse and while running the code i keep getting this error information :

[RemoteTestNG] detected TestNG version 7.0.1
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Stage
at org.testng.internal.Configuration.(Configuration.java:33)
at org.testng.TestNG.init(TestNG.java:216)
at org.testng.TestNG.(TestNG.java:200)
at org.testng.remote.AbstractRemoteTestNG.(AbstractRemoteTestNG.java:17)
at org.testng.remote.support.RemoteTestNG6_12.(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)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Stage
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 7 more
Note- Before the TestNG 7.0.1 all the script was running fine but after updated of TestNG 7.0.1. i am getting above error. Please help me out.

Adding guice4.2.2 to the project Build path worked for me.

@SinghGursimar
Copy link

SinghGursimar commented Apr 21, 2020

https://dl.bintray.com/testng-team/testng-p2-release/7.2.0/

Thx
this is working just install this in your eclipse so what this will do is update your already installed TestNG and just refresh the added libraries in your project or package

@Nayebkhail
Copy link

https://dl.bintray.com/testng-team/testng-eclipse-release/.

I have install the new think through this link and my problem has been solved .

@atul162416
Copy link

@daksha1933
Copy link

How do I add the location in System.setproperty for Microsoft edge versions 18.
I have successfully installed the driver in command prompt.

@Nayebkhail
Copy link

Nayebkhail commented Apr 25, 2020 via email

@daksha1933
Copy link

Go to you your Eclips and click in the help then click in the Install the new software and then a new window open and you can past the link in the type filter text and check the all the check box and click in the nest until the new jar files add to your system and your Eclips will request you to restart .

@daksha1933
Copy link

daksha1933 commented Apr 25, 2020

Thank you I figured it out.
We don’t need to copy the location.
After installing through Command prompt
The syntax is ::
System.setProperty(“driver.edge.driver”, “MicrosoftWebDriver.exe”);

@gajanankhareonline
Copy link

it worked for me after adding jar from https://github.com/google/guice/wiki/Guice422 to java build path

@sachinj1806
Copy link

i reported the issue here cbeust/testng#2223
we need to wait for the fix

add this dependency and the issue will get resolved

com.google.inject
guice
4.2.2

@snehal31590
Copy link

not sure how you manage the dependency in your project, but you can either downgrade to testng 7.0.0 or upgrade to 7.1.1-SNAPSHOT.

Thanks for your Help. I downgraded my TestNg to 7.0.0. It working as expected.
Thanks again.

Worked for me too. Thanks.

@bhawnajyoti
Copy link

i have replaced my jar with testng7.0.0 ...and it works..thanks

@Efredis
Copy link

Efredis commented Apr 11, 2021

Download the guice 4.2.2 Jar file to solve this issues and place that guice into project build path add it as external jars

Eres un Crack!!!! 1 día entero buscando esta solución!....

@qabashofficial
Copy link

Simply update TestNG version to 7.2.x. Fixed! That's it. Happy Testing :)
https://www.ishandevshukl.com/2021/08/exception-in-thread-main-BootstrapMethodError-NoClassDefFoundError-testng.html

@prasanthipaluri
Copy link

prasanthipaluri commented Aug 30, 2022

You just need to add "Google Guice Core Library (https://mvnrepository.com/artifact/com.google.inject/guice)" dependency in your pom.xml from mvn Repository.

com.google.inject guice 5.1.0

It worked for me.

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

No branches or pull requests