Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getDeclaredMethods getting NoClassDefFoundError

Tags:

java

maven-3

So I am loading the class and that works just fine. Then execute the getDeclaredMethods() and getting a NoClassDefFounfError. I was able to trace it inside the method and here is what is on the line.

driver = new FireFoxDriver();

When I debug look at the detailed message of NoClassDefFounfError I see the following

"org/openqa/selenium/WebDriver"

What could be causing this? I am using Maven and during the test phase I am having no issues with WebDriver running and doing the test. All the issues are happening in the site phase when it is parsing the class files for the methods. Thanks for any help.

like image 421
jrock2004 Avatar asked Jun 29 '26 18:06

jrock2004


1 Answers

Clearly there is a method that takes org.openqa.selenium.WebDriver as a parameter or returns it as a result. You aren't calling it during testing so you don't get an error, but when you introspect all the methods Java has to construct a Class object for that parameter/return value and it can't if it can't find the .class file.

like image 187
user207421 Avatar answered Jul 02 '26 08:07

user207421



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!