3

I'm getting the following error when trying to start selenium:

C:\Temp\selenium-server-1.0.3>java -jar selenium-server.jar
22:02:07.615 INFO - Java: Sun Microsystems Inc. 16.0-b13
22:02:07.617 INFO - OS: Windows 7 6.1 x86
22:02:07.625 INFO - v2.0 [a2], with Core v2.0 [a2]
22:02:07.811 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
22:02:07.813 INFO - Version Jetty/5.1.x
22:02:07.815 INFO - Started HttpContext[/selenium-server/driver,/selenium-server    /driver]
22:02:07.817 INFO - Started HttpContext[/selenium-server,/selenium-server]
22:02:07.818 INFO - Started HttpContext[/,/]
22:02:07.866 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@2bbd86

22:02:07.867 INFO - Started HttpContext[/wd,/wd]
22:02:07.870 WARN - Failed to start: SocketListener0@0.0.0.0:4444
Exception in thread "main" org.openqa.jetty.util.MultiException[java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind]
        at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:686)
        at org.openqa.jetty.util.Container.start(Container.java:72)
        at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:396)
        at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:234)
        at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:198)
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at org.openqa.jetty.util.ThreadedServer.newServerSocket(ThreadedServer.java:391)
        at org.openqa.jetty.util.ThreadedServer.open(ThreadedServer.java:477)
        at org.openqa.jetty.util.ThreadedServer.start(ThreadedServer.java:503)
        at org.openqa.jetty.http.SocketListener.start(SocketListener.java:204)
        at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:716)
        at org.openqa.jetty.util.Container.start(Container.java:72)
        at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:396)
        at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:234)
        at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:198)

Java is installed:

C:\Temp\selenium-server-1.0.3>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
Mithical
  • 103
  • 1
  • 5

4 Answers4

7

Try this (netstat -a) on Command Prompt to see if this port (4444 - Selenium Default Port) is being used by some other Service OR Listening.

OR

Start selenium using different port.

Example:

java -jar selenium-server.jar -port 5561

Thanks,

Ara

2

Run this in any of your browsers:

http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer

studiohack
  • 305
  • 5
  • 17
2

Ofcourse you can can release the port. Follow the below steps to release the port

  1. type 'Netstat -a -n -o' on your command prompt
  2. Note the PID corresponds to the port which you want to release
  3. type the command 'tasklist /svc /FI "PID eq <>"'
  4. Note the task name listed on command prompt (below Image name)
  5. Kill that task from taskmanager
1

Since you're getting an unhandled exception error, you should probably bring this to the attention of the Selenium authors. They have a bugtracker should use.

The root cause seems to be the line Unrecognized Windows Sockets error: 0: JVM_Bind. A quick google search suggests this is not a unique problem.

jldugger
  • 14,122
  • 19
  • 73
  • 129