0

我是硒的新手。我正在运行现有的 selenium RC 代码。当我尝试启动集线器时,出现以下错误

无法找到 tools.jar。预计在 C:\Program Files\Java\jre6\lib\tools.jar Buildfile 中找到它:build.xml 不存在!构建失败

所以我下载了JDK文件。然后我更改了系统变量现在它指向

C:\>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_11

C:\>echo %PATH%
c:\ruby\bin;C:\ant\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C
:\Program Files\Windows Imaging\;C:\Program Files\Common Files\Roxio Shared\DLLS
hared\;C:\Program Files\Java\jre1.6.0_05\bin;C:\Program Files\Java\jdk1.7.0_11

C:\>echo %ANT_HOME%
C:\ant\bin\ant.bat

我运行了以下 bat 文件来启动集线器 - 启动 hub.bat

title Hub
cd C:\selenium\Grid\selenium-grid-1.0.4
c:\ant\bin\ant launch-hub

输出

C:\selenium\Grid\selenium-grid-1.0.4>c:\ant\bin\ant launch-hub
Buildfile: build.xml

launch-hub:
     [java] jan 16, 2013 2:45:25 PM com.thoughtworks.selenium.grid.hub.HubRegist
ry gridConfiguration
     [java] INFO: Loaded grid configuration:
     [java] ---
     [java] hub:
     [java]   environments:
     [java]     -
     [java]       browser: "*firefox"
     [java]       name: Firefox on Windows
     [java]     -
     [java]       browser: "*firefox"
     [java]       name: Firefox on OS X
     [java]     -
     [java]       browser: "*firefox"
     [java]       name: Firefox on Linux
     [java]     -
     [java]       browser: "*iehta"
     [java]       name: IE on Windows
     [java]     -
     [java]       browser: "*safari"
     [java]       name: Safari on OS X
     [java]     -
     [java]       browser: "*firefox"
     [java]       name: "*firefox"
     [java]     -
     [java]       browser: "*firefox2"
     [java]       name: "*firefox2"
     [java]     -
     [java]       browser: "*firefox3"
     [java]       name: "*firefox3"
     [java]     -
     [java]       browser: "*chrome"
     [java]       name: "*chrome"
     [java]     -
     [java]       browser: "*iexplore"
     [java]       name: "*iexplore"
     [java]     -
     [java]       browser: "*iehta"
     [java]       name: "*iehta"
     [java]     -
     [java]       browser: "*safari"
     [java]       name: "*safari"
     [java]     -
     [java]       browser: "*opera"
     [java]       name: "*opera"
     [java]     -
     [java]       browser: "*googlechrome"
     [java]       name: "*googlechrome"
     [java]     -
     [java]       browser: "*firefoxproxy"
     [java]       name: "*firefoxproxy"
     [java]     -
     [java]       browser: "*pifirefox"
     [java]       name: "*pifirefox"
     [java]     -
     [java]       browser: "*iexploreproxy"
     [java]       name: "*iexploreproxy"
     [java]     -
     [java]       browser: "*piiexplore"
     [java]       name: "*piiexplore"
     [java]     -
     [java]       browser: "*safariproxy"
     [java]       name: "*safariproxy"
     [java]
     [java] 2013-01-16 14:45:25.161::INFO:  Logging to STDERR via org.mortbay.lo
g.StdErrLog
     [java] 2013-01-16 14:45:25.224::INFO:  jetty-6.0.x
     [java] 2013-01-16 14:45:25.364::WARN:  failed SocketConnector @ 0.0.0.0:444
4
     [java] java.net.BindException: Address already in use: JVM_Bind
     [java]     at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
     [java]     at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl
.java:376)
     [java]     at java.net.TwoStacksPlainSocketImpl.bind(TwoStacksPlainSocketIm
pl.java:101)
     [java]     at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
     [java]     at java.net.ServerSocket.bind(ServerSocket.java:376)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:237)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:181)
     [java]     at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketC
onnector.java:78)
     [java]     at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.ja
va:72)
     [java]     at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector
.java:251)
     [java]     at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector
.java:145)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at org.mortbay.jetty.Server.doStart(Server.java:239)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServer.main(HubServer.j
ava:39)
     [java] 2013-01-16 14:45:25.364::WARN:  failed Server@d38c3d
     [java] java.net.BindException: Address already in use: JVM_Bind
     [java]     at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
     [java]     at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl
.java:376)
     [java]     at java.net.TwoStacksPlainSocketImpl.bind(TwoStacksPlainSocketIm
pl.java:101)
     [java]     at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
     [java]     at java.net.ServerSocket.bind(ServerSocket.java:376)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:237)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:181)
     [java]     at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketC
onnector.java:78)
     [java]     at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.ja
va:72)
     [java]     at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector
.java:251)
     [java]     at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector
.java:145)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at org.mortbay.jetty.Server.doStart(Server.java:239)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServer.main(HubServer.j
ava:39)
     [java] Exception in thread "main" java.net.BindException: Address already i
n use: JVM_Bind
     [java]     at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
     [java]     at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl
.java:376)
     [java]     at java.net.TwoStacksPlainSocketImpl.bind(TwoStacksPlainSocketIm
pl.java:101)
     [java]     at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:175)
     [java]     at java.net.ServerSocket.bind(ServerSocket.java:376)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:237)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:181)
     [java]     at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketC
onnector.java:78)
     [java]     at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.ja
va:72)
     [java]     at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector
.java:251)
     [java]     at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector
.java:145)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at org.mortbay.jetty.Server.doStart(Server.java:239)
     [java]     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:40)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServer.main(HubServer.j
ava:39)

我的培训文件说我应该 • 等待看到'started Socket Connector' 语句和'44';

但我没明白。我认为这是因为 SocketConnector 失败。请帮我修复它。

4

1 回答 1

1

这些行告诉您端口 4444 已被另一个进程打开

 [java] 2013-01-16 14:45:25.364::WARN:  failed SocketConnector @ 0.0.0.0:4444
 [java] java.net.BindException: Address already in use: JVM_Bind

您应该检查此过程可能是什么并将其关闭,或修改您的 build.xml 以更改集线器要启动的端口

netstat -an在 Windows 上使用

注意:如果您多次运行 ant 文件,打开 4444 端口的进程可能与您尝试启动的进程相同,但尚未终止。

于 2013-01-16T16:12:23.817 回答