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

后端 未结 2 1429
南方客
南方客 2021-01-14 05:18

I am running selenium test in maven project.This project is GWT Web application.There are GWT dependencies,hibernate dependencies in pom.xml.I have created a new class in te

相关标签:
2条回答
  • 2021-01-14 05:30

    A NoSuchMethodError indicates that classes available at runtime are different to those used to compile your code.

    It usually boils down to having multiple versions of the same class on the classpath. Double check this for the class in question and remove the unwanted version.

    [EDIT] Add this to your pom.xml to control the version of httpclient:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>[4.2.1]</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    0 讨论(0)
  • 2021-01-14 05:39

    In my case the problem was the order in the java build path in my IDE. The selenium libraries were building at the end, and I solved it put them at top of the list.

    I hope it helps.

    Regards

    0 讨论(0)
提交回复
热议问题