NoSuchMethodError:org.apache.http.conn.scheme.Scheme。<init>(Ljava / lang / String; ILorg / apache / http / conn / scheme / SchemeSocketFactory;)V </init>

时间:2013-06-04 07:12:26

标签: java maven gwt selenium-webdriver

我在maven项目中运行selenium测试。这个项目是GWT Web应用程序。在pom.xml中有GWT依赖项,hibernate依赖项。我在测试包中创建了一个新类来运行selenium测试用例。我也有在pom.xml中包含了selenium server-2.33.0依赖项,但得到以下异常: -

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:59)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:48)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:100)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:81)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:81)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:244)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:188)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:183)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:179)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)

同时获取chrome驱动程序的异常。请指导我如何解决此问题。

我在pom.xml中使用以下依赖项: -

   <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <!-- POM file generated with GWT webAppCreator -->
    <modelVersion>4.0.0</modelVersion>
    <groupId>SeleniumDemo</groupId>
    <artifactId>SeleniumDemo</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>GWT Maven Archetype</name>

    <properties>
        <!-- Convenience property to set the GWT version -->
        <gwtVersion>2.4.0</gwtVersion>
        <!-- GWT needs at least java 1.5 -->
        <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwtVersion}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwtVersion}</version>
            <scope>provided</scope>
        </dependency>

        <!-- <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> 
            <version>4.7</version> <scope>test</scope> </dependency> -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.9</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <classifier>sources</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.1.7.Final</version>
        </dependency>


        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.33.0</version>
        </dependency>


        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-servlet</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.18</version>
        </dependency>
        <dependency>
            <groupId>com.google.guiceberry</groupId>
            <artifactId>guiceberry</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-gwt</artifactId>
            <version>13.0</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>


        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-assisted-inject</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.mvp4g</groupId>
            <artifactId>mvp4g</artifactId>
            <version>1.4.0</version>
        </dependency>

        <dependency>
            <groupId>gwt-maps</groupId>
            <artifactId>gwt-maps</artifactId>
            <version>3.0.2b.gwt22</version>
        </dependency>

        <dependency>
            <groupId>gwt-html5-geolocation</groupId>
            <artifactId>gwt-html5-geolocation</artifactId>
            <version>gwt-html5-geolocation</version>
        </dependency>

        <dependency>
            <groupId>com.googlecode.gwtupload</groupId>
            <artifactId>gwtupload</artifactId>
            <version>0.6.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-spatial</artifactId>
            <version>3.4.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-misc</artifactId>
            <version>3.0.2</version>
        </dependency>
        <dependency>
            <groupId>com.restfb</groupId>
            <artifactId>restfb</artifactId>
            <version>1.6.11</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
        </dependency>
        <dependency>
            <groupId>gwt-servlet</groupId>
            <artifactId>deps</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.carrotsearch</groupId>
            <artifactId>junit-benchmarks</artifactId>
            <version>0.4.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.170</version>
        </dependency>

        <!-- Hibernate c3p0 connection pool -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>4.1.7.Final</version>
        </dependency>

        <!-- Dependency for Encryption/Decryption -->
        <dependency>
            <groupId>com.googlecode.gwt.crypto</groupId>
            <artifactId>gwt-crypto</artifactId>
            <version>1.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-gwt-server</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-gwt-client</artifactId>
            <version>1.0.1</version>
        </dependency>

        <dependency>
            <groupId>eu.infomas</groupId>
            <artifactId>annotation-detector</artifactId>
            <version>3.0.1</version>
        </dependency>

        <!-- Mail dependencies -->

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mailapi</artifactId>
            <version>1.4.3</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>


    </dependencies>

</project>

运行mvn dependency:tree命令后,输出如下:

root@dhananjay:~# cd /root/helios/workspace/SeleniumDemo
root@dhananjay:~/helios/workspace/SeleniumDemo# mvn dependency:tree
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom
680b downloaded  (wagon-provider-api-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom
5K downloaded  (wagon-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
9K downloaded  (maven-parent-4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2.pom
637b downloaded  (wagon-file-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom
1K downloaded  (wagon-providers-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
1K downloaded  (wagon-webdav-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom
648b downloaded  (slide-webdavlib-2.1.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom
6K downloaded  (commons-httpclient-2.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
248b downloaded  (xml-im-exporter-1.1.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2.pom
1K downloaded  (wagon-http-lightweight-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2.pom
845b downloaded  (wagon-http-shared-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.pom
1K downloaded  (jtidy-4aug2000r7-dev.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.pom
1K downloaded  (doxia-sink-api-1.0-alpha-10.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia/1.0-alpha-10/doxia-1.0-alpha-10.pom
8K downloaded  (doxia-1.0-alpha-10.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-parent/6/maven-parent-6.pom
19K downloaded  (maven-parent-6.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2.pom
1K downloaded  (wagon-ssh-external-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2.pom
851b downloaded  (wagon-ssh-common-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-7/plexus-container-default-1.0-alpha-7.pom
1K downloaded  (plexus-container-default-1.0-alpha-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/plexus/plexus-containers/1.0.2/plexus-containers-1.0.2.pom
471b downloaded  (plexus-containers-1.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/plexus/plexus-root/1.0.3/plexus-root-1.0.3.pom
5K downloaded  (plexus-root-1.0.3.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/plexus/plexus-utils/1.0.2/plexus-utils-1.0.2.pom
740b downloaded  (plexus-utils-1.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2.pom
1K downloaded  (wagon-ssh-1.0-beta-2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/com/jcraft/jsch/0.1.27/jsch-0.1.27.pom
965b downloaded  (jsch-0.1.27.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
2K downloaded  (plexus-utils-1.4.6.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/file-management/1.1/file-management-1.1.pom
2K downloaded  (file-management-1.1.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-components/4/maven-shared-components-4.pom
2K downloaded  (maven-shared-components-4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-io/1.0/maven-shared-io-1.0.pom
2K downloaded  (maven-shared-io-1.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-artifact/2.0.2/maven-artifact-2.0.2.pom
765b downloaded  (maven-artifact-2.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven/2.0.2/maven-2.0.2.pom
12K downloaded  (maven-2.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-artifact-manager/2.0.2/maven-artifact-manager-2.0.2.pom
1K downloaded  (maven-artifact-manager-2.0.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-6/wagon-provider-api-1.0-alpha-6.pom
588b downloaded  (wagon-provider-api-1.0-alpha-6.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/wagon/wagon/1.0-alpha-6/wagon-1.0-alpha-6.pom
6K downloaded  (wagon-1.0-alpha-6.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-utils/1.2/plexus-utils-1.2.pom
767b downloaded  (plexus-utils-1.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus/1.0.5/plexus-1.0.5.pom
5K downloaded  (plexus-1.0.5.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-dependency-analyzer/1.1/maven-dependency-analyzer-1.1.pom
4K downloaded  (maven-dependency-analyzer-1.1.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/asm/asm/3.0/asm-3.0.pom
360b downloaded  (asm-3.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/asm/asm-parent/3.0/asm-parent-3.0.pom
2K downloaded  (asm-parent-3.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-project/2.0.5/maven-project-2.0.5.pom
1K downloaded  (maven-project-2.0.5.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven/2.0.5/maven-2.0.5.pom
5K downloaded  (maven-2.0.5.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-model/2.0.5/maven-model-2.0.5.pom
2K downloaded  (maven-model-2.0.5.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-artifact/2.0.5/maven-artifact-2.0.5.pom
727b downloaded  (maven-artifact-2.0.5.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-dependency-tree/1.2/maven-dependency-tree-1.2.pom
3K downloaded  (maven-dependency-tree-1.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-components/9/maven-shared-components-9.pom
3K downloaded  (maven-shared-components-9.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom
2K downloaded  (maven-project-2.0.8.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven/2.0.8/maven-2.0.8.pom
11K downloaded  (maven-2.0.8.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.pom
1K downloaded  (maven-common-artifact-filters-1.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-components/8/maven-shared-components-8.pom
2K downloaded  (maven-shared-components-8.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom
1K downloaded  (maven-artifact-2.0.8.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.pom
6K downloaded  (maven-plugin-testing-harness-1.1.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-components/7/maven-shared-components-7.pom
2K downloaded  (maven-shared-components-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-project/2.0/maven-project-2.0.pom
1K downloaded  (maven-project-2.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom
5K downloaded  (maven-core-2.0.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.pom
1K downloaded  (plexus-utils-1.4.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.pom
1K downloaded  (plexus-archiver-1.0-alpha-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/reporting/maven-reporting-impl/2.0.4/maven-reporting-impl-2.0.4.pom
1K downloaded  (maven-reporting-impl-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/reporting/maven-reporting/2.0.4/maven-reporting-2.0.4.pom
700b downloaded  (maven-reporting-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven/2.0.4/maven-2.0.4.pom
11K downloaded  (maven-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-project/2.0.4/maven-project-2.0.4.pom
1K downloaded  (maven-project-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia-core/1.0-alpha-7/doxia-core-1.0-alpha-7.pom
1K downloaded  (doxia-core-1.0-alpha-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/oro/oro/2.0.7/oro-2.0.7.pom
141b downloaded  (oro-2.0.7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/maven-plugin-api/2.0.4/maven-plugin-api-2.0.4.pom
643b downloaded  (maven-plugin-api-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/reporting/maven-reporting-api/2.0.4/maven-reporting-api-2.0.4.pom
902b downloaded  (maven-reporting-api-2.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia-site-renderer/1.0-alpha-7/doxia-site-renderer-1.0-alpha-7.pom
1K downloaded  (doxia-site-renderer-1.0-alpha-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-i18n/1.0-beta-6/plexus-i18n-1.0-beta-6.pom
771b downloaded  (plexus-i18n-1.0-beta-6.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-components/1.1.4/plexus-components-1.1.4.pom
2K downloaded  (plexus-components-1.1.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/codehaus/plexus/plexus-velocity/1.1.2/plexus-velocity-1.1.2.pom
7K downloaded  (plexus-velocity-1.1.2.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.pom
168b downloaded  (commons-logging-api-1.0.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/velocity/velocity/1.4/velocity-1.4.pom
2K downloaded  (velocity-1.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/velocity/velocity-dep/1.4/velocity-dep-1.4.pom
1K downloaded  (velocity-dep-1.4.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia-decoration-model/1.0-alpha-7/doxia-decoration-model-1.0-alpha-7.pom
1K downloaded  (doxia-decoration-model-1.0-alpha-7.pom)
Downloading: http://1.1.1.1:7080/artifactory/repo/oro/oro/2.0.7/oro-2.0.7.jar
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/doxia/doxia-core/1.0-alpha-7/doxia-core-1.0-alpha-7.jar
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/reporting/maven-reporting-impl/2.0.4/maven-reporting-impl-2.0.4.jar
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/file-management/1.1/file-management-1.1.jar
63K downloaded  (oro-2.0.7.jar)
30K downloaded  (file-management-1.1.jar)
Downloading: http://1.1.1.1:7080/artifactory/repo/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar
13K downloaded  (maven-reporting-impl-2.0.4.jar)
Downloading: http://1.1.1.1:7080/artifactory/repo/velocity/velocity/1.4/velocity-1.4.jar
25K downloaded  (commons-logging-api-1.0.4.jar)
Downloading: http://1.1.1.1:7080/artifactory/repo/asm/asm/3.0/asm-3.0.jar
156K downloaded  (plexus-utils-1.0.2.jar)
Downloading: http://1.1.1.1:7080/artifactory/repo/commons-collections/commons-collections/2.1/commons-collections-2.1.jar
41K downloaded  (asm-3.0.jar)
Downloading: http://1.1.1.1:7080/artifactory/repo/org/apache/maven/shared/maven-shared-io/1.0/maven-shared-io-1.0.jar
26K downloaded  (maven-dependency-analyzer-1.1.jar)
[INFO] [dependency:tree {execution: default-cli}]
[INFO] SeleniumDemo:SeleniumDemo:war:0.0.1-SNAPSHOT
[INFO] +- com.google.gwt:gwt-servlet:jar:2.4.0:runtime
[INFO] +- com.google.gwt:gwt-user:jar:2.4.0:provided
[INFO] +- junit:junit:jar:4.9:test (scope not updated to compile)
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- javax.validation:validation-api:jar:1.0.0.GA:test
[INFO] +- javax.validation:validation-api:jar:sources:1.0.0.GA:test
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.1.7.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:4.1.7.Final:compile
[INFO] |  |  \- antlr:antlr:jar:2.7.7:compile
[INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.seleniumhq.selenium:selenium-java:jar:2.33.0:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-android-driver:jar:2.33.0:compile
[INFO] |  |  \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.33.0:compile
[INFO] |  |     \- cglib:cglib-nodep:jar:2.1_3:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.33.0:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.33.0:compile
[INFO] |  |  +- net.sourceforge.htmlunit:htmlunit:jar:2.12:compile
[INFO] |  |  |  +- xalan:xalan:jar:2.7.1:compile
[INFO] |  |  |  |  \- xalan:serializer:jar:2.7.1:compile
[INFO] |  |  |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  |  |  +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] |  |  |  +- commons-codec:commons-codec:jar:1.7:compile
[INFO] |  |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:compile
[INFO] |  |  |  +- xerces:xercesImpl:jar:2.10.0:compile
[INFO] |  |  |  |  \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] |  |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:compile
[INFO] |  |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.9:compile
[INFO] |  |  |  |  \- org.w3c.css:sac:jar:1.3:compile
[INFO] |  |  |  +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:compile
[INFO] |  |  |     +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:compile
[INFO] |  |  |     +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:compile
[INFO] |  |  |     \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:compile
[INFO] |  |  \- org.apache.httpcomponents:httpclient:jar:4.2.1:compile
[INFO] |  |     \- org.apache.httpcomponents:httpcore:jar:4.2.1:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.33.0:compile
[INFO] |  |  \- org.apache.commons:commons-exec:jar:1.1:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.33.0:compile
[INFO] |  |  +- net.java.dev.jna:jna:jar:3.4.0:compile
[INFO] |  |  \- net.java.dev.jna:platform:jar:3.4.0:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.33.0:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.33.0:compile
[INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.33.0:compile
[INFO] |  |  \- org.seleniumhq.selenium:selenium-api:jar:2.33.0:compile
[INFO] |  \- org.webbitserver:webbit:jar:0.4.14:compile
[INFO] |     \- io.netty:netty:jar:3.5.2.Final:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] |  \- com.google.inject:guice:jar:3.0:compile
[INFO] |     \- javax.inject:javax.inject:jar:1:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile
[INFO] +- com.google.guiceberry:guiceberry:jar:3.1.0:compile
[INFO] |  \- com.google.guava:guava-testlib:jar:10.0:compile
[INFO] +- com.google.guava:guava-gwt:jar:13.0:compile
[INFO] |  \- com.google.guava:guava:jar:13.0:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- com.google.inject.extensions:guice-assisted-inject:jar:2.0:compile
[INFO] +- com.googlecode.mvp4g:mvp4g:jar:1.4.0:compile
[INFO] |  \- com.google.gwt.inject:gin:jar:1.5.0:compile
[INFO] |     \- com.google.inject.extensions:guice-assistedinject:jar:3.0-rc2:compile
[INFO] +- gwt-maps:gwt-maps:jar:3.0.2b.gwt22:compile
[INFO] +- gwt-html5-geolocation:gwt-html5-geolocation:jar:gwt-html5-geolocation:compile
[INFO] +- com.googlecode.gwtupload:gwtupload:jar:0.6.4:compile
[INFO] +- org.apache.lucene:lucene-spatial:jar:3.4.0:compile
[INFO] |  +- org.apache.lucene:lucene-core:jar:3.4.0:compile
[INFO] |  \- org.apache.lucene:lucene-queries:jar:3.4.0:compile
[INFO] |     \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
[INFO] +- org.apache.lucene:lucene-misc:jar:3.0.2:compile
[INFO] +- com.restfb:restfb:jar:1.6.11:compile
[INFO] +- org.json:json:jar:20090211:compile
[INFO] +- gwt-servlet:deps:jar:1.0.0:compile
[INFO] +- com.carrotsearch:junit-benchmarks:jar:0.4.0:test
[INFO] +- com.h2database:h2:jar:1.3.170:compile
[INFO] +- org.hibernate:hibernate-c3p0:jar:4.1.7.Final:compile
[INFO] |  \- c3p0:c3p0:jar:0.9.1:compile
[INFO] +- com.googlecode.gwt.crypto:gwt-crypto:jar:1.0.2:compile
[INFO] +- org.atmosphere:atmosphere-gwt-server:jar:1.0.1:compile
[INFO] |  +- org.atmosphere:atmosphere-gwt-common:jar:1.0.1:compile
[INFO] |  \- org.atmosphere:atmosphere-runtime:jar:1.0.1:compile
[INFO] |     +- org.atmosphere:atmosphere-compat-jbossweb:jar:1.0.1:compile
[INFO] |     +- org.atmosphere:atmosphere-compat-tomcat:jar:1.0.1:compile
[INFO] |     \- org.atmosphere:atmosphere-compat-tomcat7:jar:1.0.1:compile
[INFO] +- org.atmosphere:atmosphere-gwt-client:jar:1.0.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- eu.infomas:annotation-detector:jar:3.0.1:compile
[INFO] +- javax.mail:mailapi:jar:1.4.3:compile
[INFO] +- javax.mail:mail:jar:1.4:compile
[INFO] \- javax.activation:activation:jar:1.1.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL

2 个答案:

答案 0 :(得分:3)

NoSuchMethodError表示运行时可用的类与用于编译代码的类不同。

它通常归结为类路径上具有相同类的多个版本。仔细检查相关课程,并删除不需要的版本。

<强> [编辑] 将其添加到您的pom.xml以控制httpclient的版本:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>[4.2.1]</version>
        </dependency>
    </dependencies>
</dependencyManagement>

答案 1 :(得分:1)

在我的情况下,问题是我的IDE中的java构建路径中的顺序。最后,selenium库正在构建,我解决了它,将它们放在列表的顶部。

我希望它有所帮助。

此致