java.lang.NoClassDefFoundError:com/google/common/collect/Maps-硒 [英] java.lang.NoClassDefFoundError: com/google/common/collect/Maps - Selenium

查看:403
本文介绍了java.lang.NoClassDefFoundError:com/google/common/collect/Maps-硒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的硒专家,

我遇到了JPA 2.0程序出现的以下运行时错误,该错误似乎由于某些原因与Firefox配置文件有关:

I have come across the following run-time error from a JPA 2.0 program which appears to be related to 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
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 4 more
Java Result: 1

我将Firefox保留为版本15,以便Selenium Webdriver支持它,但怀疑问题与无法读取配置文件目录有关.

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

非常感谢您的帮助.

非常感谢,

乔治

推荐答案

您看到的问题与Firefox配置文件无关.

The problem you are seeing has nothing to do with your Firefox profile.

实际上,是JVM类加载器抱怨找不到com.google.common.collect.Maps类.

Actually, it is the JVM classloader that complains that it can't find the com.google.common.collect.Maps class.

这通常意味着您没有 Guava (这是一个依赖项)硒).清理并重建项目,检查类路径,检查其中可能存在的各种版本的库.如果您使用的是某种依赖性管理系统(Maven,Ivy等),请检查其配置是否正确.

This usually means that you don't have Guava (which is a dependency for Selenium) on your classpath. Clean and rebuild your project, check your classpath, check the various versions of libraries that might be there. If you're using some kind of dependency management system (Maven, Ivy etc.), check it's configured right.

这篇关于java.lang.NoClassDefFoundError:com/google/common/collect/Maps-硒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆