Getting java.lang.NoClassDefFoundError: org/openqa/selenium/io/CircularOutputStream

7,929 views
Skip to first unread message

Adam Mann

unread,
Mar 23, 2016, 10:29:24 AM3/23/16
to Selenium Users
Has anyone seen this?
I had a problem where using selenium 2.48.0 wasn't working with firefox 45.0.1.  I updated this to 2.53.0 and while it's still not working against firefox 45.0.1 ( error here ), against firefox 44.0.2 its more successful but I get the error mentioned in the title.  Here is my stack output:

java.lang.NoClassDefFoundError: org/openqa/selenium/io/CircularOutputStream

at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:60)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)
at org.openqa.selenium.firefox.FirefoxDriver.getBinary(FirefoxDriver.java:203)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)
at uk.gov.companieshouse.automatedtesting.concordion.web.Browser.<init>(Browser.java:221)
at uk.gov.companieshouse.automatedtesting.concordion.web.BrowserUtil.getBrowser(BrowserUtil.java:134)
at uk.gov.companieshouse.automatedtesting.concordion.web.BrowserUtil.getBrowser(BrowserUtil.java:62)
at uk.gov.companieshouse.automatedtesting.concordion.web.WebConcordionTestBase.getBrowser(WebConcordionTestBase.java:121)
at uk.gov.companieshouse.automatedtesting.concordion.web.WebConcordionTestBase.before(WebConcordionTestBase.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.io.CircularOutputStream
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 36 more


Process finished with exit code 255

Any ideas?

Krishnan Mahadevan

unread,
Mar 23, 2016, 10:33:39 AM3/23/16
to Selenium Users
You seem to have a messed up CLASSPATH. How are you setting your CLASSPATH ?

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/f11836a2-5562-46a8-bf4f-f35a4f6501d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Mann

unread,
Mar 23, 2016, 10:54:38 AM3/23/16
to Selenium Users
I'm setting it in the standard way in intellij.  I just checked inside Modules -> Dependencies and I see org.seleniumhq.selenium:selenium-java:2.53.0 (as well as the other browser drivers as well).  Is that what you were looking for?

Adam Mann

unread,
Mar 23, 2016, 10:56:06 AM3/23/16
to Selenium Users
Might also help, I'm importing them by using maven and adding the following to my pom file:

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

Krishnan Mahadevan

unread,
Mar 23, 2016, 12:53:11 PM3/23/16
to Selenium Users
Can you please try adding the below as a dependency and see if that helps ?

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.0</version>
</dependency>

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.

Adam Mann

unread,
Mar 29, 2016, 10:30:51 AM3/29/16
to Selenium Users
Same error :/
I did a bit of playing and the error happens when using selenium-java 2.50.1 and above.  Any ideas why that might be the case? Maybe a dependency was moved between those versions that something else was relying on.

Adam Mann

unread,
Mar 29, 2016, 11:25:56 AM3/29/16
to Selenium Users
I think I might have it, when I look at the selenium java github repo, inside selenium.io, you can see the circularoutputsteam class.  However, locally it's not available and it doesn't seem to be importing it, even when I delete everything out of my .m2/repositories folder. 

Terry Lacy

unread,
Apr 4, 2016, 5:14:01 PM4/4/16
to Selenium Users
Is there a fix for this?  I'm getting it too.  Changing dependencies as Krishnan suggests doesn't fix it.  Expired the cache on my nexus server and removed the selenium folders and it went away for a little while, but now it's back.

Terry

Terry Lacy

unread,
Apr 4, 2016, 5:29:28 PM4/4/16
to Selenium Users
I notice the path on my error is a bit different: "org/openqa/selenium/remote/internal/CircularOutputStream"

⇜Krishnan Mahadevan⇝

unread,
Apr 4, 2016, 11:41:42 PM4/4/16
to Selenium Users
Terry,

I still cant recreate the problem. Can there be a possibility that somewhere in your dependencies something is messing up ? Can you try creating a new simple maven project which just adds selenium 2.53.0 as dependencies and see if the problem recreates itself ?

Going by your path, it looks like it used to reside in org.openqa.selenium.remote.internal package until this commit wherein it moved to org.openqa.selenium.io package.

My dependencies :
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.0</version>
</dependency>
krmahadevan@localhost testbed $ mvn dependency:resolve | grep selenium
[INFO]    org.seleniumhq.selenium:selenium-edge-driver:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-leg-rc:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-java:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-server:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-ie-driver:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-remote-driver:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-support:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:jetty-rc-repacked:jar:5:compile
[INFO]    org.seleniumhq.selenium:selenium-safari-driver:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-firefox-driver:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:jetty-repacked:jar:9.2.13.v20150730:compile
[INFO]    org.seleniumhq.selenium:selenium-api:jar:2.53.0:compile
[INFO]    org.seleniumhq.selenium:selenium-chrome-driver:jar:2.53.0:compile

A sample code that I run :

public class FirefoxDemo {
public static void main(String[] args) {
FirefoxDriver driver = null;
try {
driver = new FirefoxDriver();
String location = driver.getClass().getProtectionDomain().getCodeSource()
.getLocation().toExternalForm();
System.err.println("Working with Selenium : " + new File(location).getParentFile().getName());
driver.get("http://the-internet.herokuapp.com");
System.err.println("Page Title :" + driver.getTitle());
String userAgent = (String) driver.executeScript("return navigator.userAgent;");
ReadableUserAgent ua =
UADetectorServiceFactory.getResourceModuleParser().parse(userAgent);
String browserVersion = ua.getVersionNumber().getMajor() + "." + ua.getVersionNumber().getMinor();
String osName = ua.getOperatingSystem().getName();
String osVersion = ua.getOperatingSystem().getVersionNumber().getMajor() + "." +
ua.getOperatingSystem().getVersionNumber().getMinor();
String msg = String.format("Running %s version:%s on %s version :%s", ua.getName(), browserVersion,
osName, osVersion);
System.err.println("**" + msg);
} finally {
if (driver != null) {
driver.quit();
}
}
}
}

Output :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
Working with Selenium : 2.53.0
Page Title :The Internet
**Running Firefox version:45.0 on OS X version :10.11

Process finished with exit code 0


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.

Terry Lacy

unread,
Apr 5, 2016, 11:51:03 AM4/5/16
to Selenium Users
Thanks, Krishnan.

I eventually found a deeply buried dependency on an older version of Selenium.  Once I got rid of that, the error went away.  I need to learn to look at the dependencies chains in Eclipse when I'm doing an upgrade.  I also got rid of redundant dependencies on Selenium that way.

Thanks,
Terry

⇜Krishnan Mahadevan⇝

unread,
Apr 6, 2016, 12:08:13 AM4/6/16
to Selenium Users
No worries. I have found the "dependency hierarchy" view that eclipse provides when I open up the pom file to be useful.

You can also try using the command : mvn dependency:tree 
from the command line to and explore its output as well.

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/

Ernest Munoz

unread,
Apr 15, 2016, 1:56:44 AM4/15/16
to Selenium Users
Ran into this exact same issue recently and was able to fix it by removing an older phantomjs dependency (1.2.0) from my pom file.

Andreas Heinz

unread,
Apr 29, 2016, 10:26:47 AM4/29/16
to Selenium Users
Thx, Ernest, removing the older phantomjs dependency also worked for me - as well as updating to phantomjsdriver version 1.3.0.

Nachiket Deshpande

unread,
May 16, 2016, 5:40:16 PM5/16/16
to Selenium Users
Hello,

I'm not able to understand "how to find phantomjs dependency with old selenium version and remove it", can anyone please explain or redirect any link to read about it ?

Thanks in advance.

Krishnan Mahadevan

unread,
May 16, 2016, 10:26:28 PM5/16/16
to Selenium Users

How are you setting up your classpath ?

In the case of Heinz they were working with a maven project and their project was also depending upon phantomjs. Is that the case with you as well ?

 

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/

 

Nagarjuna Madineni

unread,
Aug 23, 2016, 6:20:47 AM8/23/16
to Selenium Users
Hi Adam,

I am facing this issue  and i found the solution for this and it will run ff 46, 47, and 48 also..

java.lang.NoClassDefFoundError: org/openqa/selenium/io/CircularOutputStream

This class is not found in selenium-java dependency

that is present in the selenium- remote- driver dependency.


Add the dependency in the pom

<dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-remote-driver</artifactId>
      <version>2.53.1</version>
    </dependency>

Check that class is present on the dependency..

Message has been deleted

Santosh Kumar

unread,
Sep 23, 2016, 10:50:49 AM9/23/16
to Selenium Users
Thank you very much Nagaraju
Your solution helped me a lot
It worked for me
Reply all
Reply to author
Forward
0 new messages