Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

java.lang.NoSuchFieldError: INSTANCE #7480

Closed
lukeis opened this issue Mar 4, 2016 · 9 comments
Closed

java.lang.NoSuchFieldError: INSTANCE #7480

lukeis opened this issue Mar 4, 2016 · 9 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7480

Running selenium-server-standalone-2.42.0 with Firefox 30 on Windows 7.

The following code:
    WebDriver driver = new FirefoxDriver()
    driver.get("http://google.com")

Produces:

Caught: java.lang.NoSuchFieldError: INSTANCE
java.lang.NoSuchFieldError: INSTANCE
    at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
    at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
    at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
    at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
    at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
    at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:487)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:147)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:136)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:112)
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:68)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:55)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:93)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
    at com.cantor.test.Scratch.run(Scratch.groovy:12)

Reported by mark.lehky on 2014-06-13 18:31:22

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Apparently there is no way to edit my original post?

My code is missing a bracket; it should say:
    WebDriver driver = new FirefoxDriver();
    driver.get("http://google.com");

I also tried with Selenium version 2.42.1 and 2 (latest) with same results.

Reported by mark.lehky on 2014-06-13 18:34:12

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Selenium 2.42 requires httpclient-4.3, please remove older httpclient versions from
the classpath

Reported by barancev on 2014-06-17 12:29:26

  • Status changed: Invalid
  • Labels added: Lang-Java

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

The only version of httpclient that I have is 4.3.2

[INFO] net.sourceforge.sebase:groovy:jar:1.5
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.seleniumhq.selenium:selenium-java:jar:2.39.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.42.2:test
[INFO] |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.42.2:test
[INFO] |  |  +- net.sourceforge.htmlunit:htmlunit:jar:2.14:test
[INFO] |  |  |  +- xalan:xalan:jar:2.7.1:test
[INFO] |  |  |  |  \- xalan:serializer:jar:2.7.1:test
[INFO] |  |  |  +- org.apache.commons:commons-lang3:jar:3.2.1:test
[INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.3.2:test
[INFO] |  |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.14:test
[INFO] |  |  |  +- xerces:xercesImpl:jar:2.11.0:test
[INFO] |  |  |  |  \- xml-apis:xml-apis:jar:1.4.01:test
[INFO] |  |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.20:test
[INFO] |  |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.13:test
[INFO] |  |  |  |  \- org.w3c.css:sac:jar:1.3:test
[INFO] |  |  |  \- org.eclipse.jetty:jetty-websocket:jar:8.1.14.v20131031:test
[INFO] |  |  |     +- org.eclipse.jetty:jetty-util:jar:8.1.14.v20131031:test
[INFO] |  |  |     +- org.eclipse.jetty:jetty-io:jar:8.1.14.v20131031:test
[INFO] |  |  |     \- org.eclipse.jetty:jetty-http:jar:8.1.14.v20131031:test
[INFO] |  |  \- org.apache.httpcomponents:httpclient:jar:4.3.2:test
[INFO] |  |     \- org.apache.httpcomponents:httpcore:jar:4.3.1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.42.2:test
[INFO] |  |  +- commons-io:commons-io:jar:2.4:test
[INFO] |  |  \- org.apache.commons:commons-exec:jar:1.1:test
[INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.42.2:test
[INFO] |  |  +- net.java.dev.jna:jna:jar:3.4.0:test
[INFO] |  |  \- net.java.dev.jna:platform:jar:3.4.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.42.2:test
[INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.42.2:test
[INFO] |  |  \- org.seleniumhq.selenium:selenium-api:jar:2.42.2:test
[INFO] |  \- org.webbitserver:webbit:jar:0.4.14:test
[INFO] |     \- io.netty:netty:jar:3.5.2.Final:test
[INFO] +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.1.0:test
[INFO] |  +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.39.0:test
[INFO] |  |  +- cglib:cglib-nodep:jar:2.1_3:test
[INFO] |  |  +- org.json:json:jar:20080701:test
[INFO] |  |  \- com.google.guava:guava:jar:15.0:test
[INFO] |  \- org.seleniumhq.selenium:selenium-server:jar:2.39.0:test
[INFO] |     +- org.bouncycastle:bcprov-jdk15on:jar:1.48:test
[INFO] |     +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:test
[INFO] |     +- mx4j:mx4j-tools:jar:3.0.1:test
[INFO] |     +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:test
[INFO] |     +- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:test
[INFO] |     +- net.jcip:jcip-annotations:jar:1.0:test
[INFO] |     \- org.yaml:snakeyaml:jar:1.8:test
[INFO] +- commons-lang:commons-lang:jar:2.4:test
[INFO] +- org.codehaus.groovy.modules.http-builder:http-builder:jar:0.7.1:test
[INFO] |  +- net.sf.json-lib:json-lib:jar:jdk15:2.3:test
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.8.0:test
[INFO] |  |  +- commons-collections:commons-collections:jar:3.2.1:test
[INFO] |  |  +- commons-logging:commons-logging:jar:1.1.1:test
[INFO] |  |  \- net.sf.ezmorph:ezmorph:jar:1.0.6:test
[INFO] |  \- xml-resolver:xml-resolver:jar:1.2:test
[INFO] +- org.apache.poi:poi:jar:3.10-FINAL:test
[INFO] |  \- commons-codec:commons-codec:jar:1.5:test
[INFO] +- net.sf.jacob-project:jacob:jar:1.14.3:test
[INFO] +- com.sun.jna:jna:jar:3.0.9:test
[INFO] +- com.googlecode.autoitx4java:AutoItX4Java:jar:1.0:test
[INFO] +- net.sf.jpdfunit:jpdfunit:jar:1.2:test
[INFO] |  \- org.apache.pdfbox:pdfbox:jar:1.8.5:test
[INFO] |     +- org.apache.pdfbox:fontbox:jar:1.8.5:test
[INFO] |     \- org.apache.pdfbox:jempbox:jar:1.8.5:test
[INFO] +- org.gebish:geb-core:jar:0.9.3:test
[INFO] |  +- org.gebish:geb-ast:jar:0.9.3:test
[INFO] |  \- org.gebish:geb-waiting:jar:0.9.3:test
[INFO] |     \- org.gebish:geb-implicit-assertions:jar:0.9.3:test
[INFO] \- org.codehaus.groovy:groovy-all:jar:2.1.5:compile

Reported by mark.lehky on 2014-06-17 14:06:42

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

The attached maven project works as expected for me, you can try it to retest the issue.

Reported by barancev on 2014-06-17 14:48:31


- _Attachment: [sample.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-7480/comment-4/sample.zip)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Nothing in my project changed, but I cannot reproduce it today. :(
The magic gnomes fell asleep today?

Reported by mark.lehky on 2014-06-17 15:52:08

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I get the same error using 'org.seleniumhq.selenium:selenium-java:2.42.3'. when I switched
to 2.42.2 I was able to launch chrome. I'm using gradle and testng. 

Reported by jonathan.major@incapturetechnologies.com on 2014-08-13 20:18:22

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Just check whether you have two same jar with different version. I got the same error
then I figured I have duplicate jars with different version. After removing those duplicate
jars I am able to launch the browser.

Reported by shakun.tyagi10 on 2014-09-03 08:08:56

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

 #7 shakun.t...@gmail.com was correct. 
Thanks,
Muthu.

Reported by muthu.kasthuri on 2014-12-15 06:20:35

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:22:35

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant