Selenium WebDriver “could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory”

962 views
Skip to first unread message

Brendon Allen

unread,
Oct 27, 2017, 1:30:52 PM10/27/17
to Selenium Users
Anyone else seen this one?  Thanks in advance I am just out of ideas.


About 4 days ago seemingly without any changes on our side (or so git says) all our selenium test cases on Browser Stack started failing. It is the same for each one

com.iris.selenium.devicedetails.WaterLeakDetector > testDeviceDetails[0] FAILED
java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:71)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:57)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:60)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:242)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:219)
    at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:93)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:72)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:59)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)
    at com.iris.selenium.devicedetails.WaterLeakDetector.setUp(WaterLeakDetector.java:66)

java.lang.NullPointerException
    at com.iris.selenium.devicedetails.WaterLeakDetector.tearDown(WaterLeakDetector.java:146)

that line is where it creates the new RemoteWebDriver

    DesiredCapabilities capability = new DesiredCapabilities();
    capability.setCapability("platform", platform);
    capability.setCapability("browser", browserName);
    capability.setCapability("browserVersion", browserVersion);
    capability.setCapability("browserstack.selenium_version", "3.6.0");
    capability.setCapability("build", "JUnit-Parallel");
    capability.setCapability("acceptSslCerts", true);
    driver = new RemoteWebDriver(new URL(BROWSERSTACKURL), capability);

In my gradle dependencies I have

dependencies {
    compile 'org.seleniumhq.selenium:selenium-java:3.6.0'
    //   compile 'org.seleniumhq.selenium:selenium-remote-driver:3.6.0'
    compile 'junit:junit:4.11'
    //   compile  'org.apache.httpcomponents:httpclient:4.5.3'
    //   compile 'org.apache.httpcomponents:httpcore:4.4.8
}

selenium-java:3.6.0 actually pulls in remote driver and httpclient it uses though as you can see I tried to bring them in specifically as well in the commented out lines.

My gradle dependencies graph is below but again I see nothing weird and it is for sure getting the appache http client libs (did as a picture here as the formatting was getting all messed up)

Gradle Dependency Graph

I am at a bit of a loss here any help appreciated.


Krishnan Mahadevan

unread,
Oct 28, 2017, 5:14:14 AM10/28/17
to seleniu...@googlegroups.com

Brandon,

 

What if you cleared up your local gradle store and retried again ? Maybe something has perhaps gotten corrupted in the Gradle store ?

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/40da1cbe-391d-435c-b52a-aabd43ba47c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brendon Allen

unread,
Oct 30, 2017, 12:21:10 PM10/30/17
to Selenium Users
Yeah tried that and it happens on multiple machines so think I am good there.  thanks for the idea though
Reply all
Reply to author
Forward
0 new messages