我是硒的新手。我正在运行一个现有的硒RC代码。当我尝试启动集线器时,我得到了以下错误
无法找到tools.jar。希望能在C:Program FilesJavajre6libtools.jar找到它Buildfile: build.xml不存在!构建失败
所以我下载了JDK文件。然后我改变了系统变量现在它指向
C:>echo %JAVA_HOME%
C:Program FilesJavajdk1.7.0_11
C:>echo %PATH%
c:rubybin;C:antbin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C
:Program FilesWindows Imaging;C:Program FilesCommon FilesRoxio SharedDLLS
hared;C:Program FilesJavajre1.6.0_05bin;C:Program FilesJavajdk1.7.0_11
C:>echo %ANT_HOME%
C:antbinant.bat
我运行以下bat文件来启动hub - launch hub.bat
title Hub
cd C:seleniumGridselenium-grid-1.0.4
c:antbinant launch-hub
C:seleniumGridselenium-grid-1.0.4>c:antbinant 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。
这些行告诉您端口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以更改集线器启动的端口
在Windows上使用netstat -an
注意:如果您已经多次运行ant文件,打开4444端口的进程可能与您试图启动的进程相同,但尚未终止。