• Register
0 votes
1.5k views

Problem  :

I have come across a below run-time error from the JPA 2.0 program I think it is related to the Firefox Profile for some reason:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
    at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:56)
    at org.openqa.selenium.firefox.FirefoxProfile.(FirefoxProfile.java:79)
    at model.DownloadCarDetail.getMercedezDetail(model.DownloadCarDetail:72)
    at model.DownloadCarDetail.getMercedezDetail.main    (model.DownloadCarDetail.getMercedezDetail.java:47)
    Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps

I have kept my Firefox to the version 15 so that it is supported by my Selenium Webdriver but I suspect that above issue is to do with not able to read the profile directory.

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

A problem that you are seeing has nothing to do with the Firefox profile.

Actually, it is related to the JVM class loader that complains that it can't you’re your  com.google.common.collect.Maps class.

This actually means that you don't have a Guava (which is the dependency for Selenium) on the class path. So you need to clean and rebuild your project and check the classpath also check your various versions of all the libraries that might be there. If you are trying to use some kind of a dependency management system like (Maven, Ivy etc.) then you need to check if it is configured correctly.

OR

A standalone package can be downloaded from the below link:

http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.20.0.jar

If you are not using it currently, the easiest solution is to switch to a standalone version.

9 7 4
38,600 points

Related questions

0 votes
1 answer 1.1K views
1.1K views
Problem : I am trying to invoke the testng programmatically. And not the eclipse plug-in. I have associated the "testng-6.8.21.jar" and I am running it through eclipse and I tried to run below code: import org.testng.TestNG; public ... .ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more
asked Jan 31, 2020 jwilliam 3.9k points
0 votes
1 answer 1 view
1 view
Problem: I'm facing the following error: error:[Ljava.lang.StackTraceElement;@80f4cb Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function Could someone help me to find the solution or reason for this?
asked 4 days ago sumaiya simi 43.9k points
0 votes
2 answers 24 views
24 views
Problem: exception in thread "main" java.lang.noclassdeffounderror: com/google/common/base/function
asked Feb 23 Muneeb Saadii 130k points
0 votes
1 answer 26 views
26 views
Your assistance would be very much appreciated. Many thanks.
asked Feb 13 TeamScript 13.5k points
0 votes
1 answer 5 views
5 views
Problem: I am trying to write a JUnit test case for the same purpose. But on line Session session = Session.getDefaultInstance(properties); I am getting the following exception: java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
asked Apr 24 ummeshani 9.5k points
0 votes
1 answer 7 views
7 views
Problem: I have setup MCP with IntelliJ IDEA but I have an issue, whenever I try to launch the game, I would have to keep trying until it works, I don't know if this will help but whenever it says Task :Compiling Java, Task : ... (ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more
asked Apr 26 anika11 32.2k points
0 votes
1 answer 13 views
13 views
Problem: I have some code that uses JAXB API classes which have been provided as a part of the JDK in Java 6/7/8. When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can not be found. The JAXB classes have been provided as a part of the JDK since Java 6, so why can Java 9 no longer find these classes?
asked Apr 25 Supti 13k points
1 vote
2 answers 7 views
7 views
Problem: Any solution of this error? Exception in thread "main" java.lang.noclassdeffounderror: org/dom4j/documentexception.
asked Apr 24 PkGuy 23.5k points
0 votes
1 answer 22 views
22 views
Problem: When installing the android sdk tools the following error is emitted: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Why is this happening and how can it be fixed? Debug output: $ java --version java 9 Java(TM) ... com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81) at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:117)
asked Apr 24 munim01 21k points
0 votes
1 answer 4 views
4 views
Problem: I am getting class not found exception while using application context in Spring Framework Here is my code... String files[] = new String[]{"car.xml","engine.xml"}; ApplicationContext applicationContext = new ClassPathXmlApplicationContext(files ... code enter code herehere at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)`` at java.lang.ClassLoader.loadClass(Unknown Source)
asked Apr 24 Humaira ahmed 50.7k points