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

RemoteWebDriver throws java.lang.ClassCastException #600

Closed
lukeis opened this issue Mar 2, 2016 · 10 comments
Closed

RemoteWebDriver throws java.lang.ClassCastException #600

lukeis opened this issue Mar 2, 2016 · 10 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 600

What steps will reproduce the problem?
1. Create RemoteWebDriver Servlet and host on jetty 6.0.2 
2. Instantiate new RemoteWebDriver instance

What is the expected output? What do you see instead?

Observed that exception thrown is: java.lang.ClassCastException: java.lang.String cannot
be cast to java.util.Map. Did not expect any output.

To debug: Created RemoteWebDriver Servlet using Eclipse and exported WAR to Apache
Tomcat 6 and verified no errors in catalina log and saw no errors unpacking WAR and
verifying jars.

What version of the product are you using? On what operating system?
OS = Windows XP for all. Using selenium-server-2.0a4.jar for both Remote Driver Server
and Client.

Please provide any additional information below.
I am attaching my RemoteServer project and the test class that tries to instantiate
the driver. By the way, I tried to use the code as posted online for the remote driver
servlet and this failed, so I had to enclose in the standard servlet syntax. I also
added details to web.xml.

Reported by richflickstein on 2010-06-24 20:16:08


- _Attachment: [AppServer6.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-600/comment-0/AppServer6.zip)_
@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by richflickstein on 2010-06-25 03:30:19


- _Attachment: [TestRemoteWebDriverServer.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-600/comment-1/TestRemoteWebDriverServer.zip)_

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

AppServer6 zip is the remote server project.
TestRemoteWebDriverServer zip is client project with RemoteWD.java, which attempts
to start the instance of the remote web driver.

Reported by richflickstein on 2010-06-25 03:32:39

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by simon.m.stewart on 2010-09-09 22:12:51

  • Labels added: NextRelease

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Looking at the example code, this looks like a common problem where the servlet has
been bound to a single URL and not all sub-paths of the URL (that is "/wd/hub" instead
of "/wd/hub/*"

There is a nasty class cast issue when the remote server dies when the last window
is closed. 

Reported by simon.m.stewart on 2010-10-08 10:57:46

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by simon.m.stewart on 2011-01-21 15:12:10

  • Labels added: Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

It happened to me on 2.0a2 but upgrading to 2.0b2 fixed the issue.

Reported by vaida.bogdan on 2011-03-11 13:39:00

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

An issue with illegal casting was probably fixed in version 2.8.0.

However, it usually hid unhandled exception occured in browser. Now you should get
more descriptive error message.

If this still an issue, don't hesitate to ask to reopen it.

Reported by barancev on 2011-11-01 15:26:03

  • Status changed: Fixed
  • Labels removed: NextRelease

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I am stuck with this problem and not sure what the workaround is - can someone pls.
help?

URL url = new URL("http://localhost:4444/node");
System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox");
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setJavascriptEnabled(true);
dc.setBrowserName("firefox");
dc.setVersion("3.6");
WebDriver driver = new RemoteWebDriver(url, dc);

gives the error:

java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:118)
    at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:76)
    at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:84)

Reported by avaidyas on 2012-01-27 18:12:40

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

i am looking for the same solution?

Reported by dobhal.ashutosh on 2013-05-13 11:32:21

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 17:49:39

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 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