Selenium 2 和 OperaDriver:java.net.BindException
我从 https://github.com/operasoftware/operadriver/ 下载了 OperaDriver 并尝试运行简单/示例.java 但我总是收到异常“java.net.BindException:地址已在使用中”? 我不明白这个 BindException 怎么会发生?如何知道哪个端口已经被占用?它没有打印在堆栈跟踪中吗? OperaDriver 默认运行在哪里?
这是完整的堆栈跟踪:
Jun 29, 2011 10:35:16 AM com.opera.core.systems.OperaDriver <init>
SEVERE: Error initializing OperaDriver with exception
org.openqa.selenium.WebDriverException: java.net.BindException: Address already in use
Build info: version: '2.0rc3', revision: '12536', time: '2011-06-20 18:19:52'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.34.8-0.2-desktop', java.version: '1.6.0_24'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.OperaDriver.createScopeServices(OperaDriver.java:233)
at com.opera.core.systems.OperaDriver.init(OperaDriver.java:192)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:147)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:105)
at ch.adnovum.wci.test.common.DriverFactory.getDriver(DriverFactory.java:132)
at ch.adnovum.wci.test.web.UpAndRunningTest.testCustomerAppOpera(UpAndRunningTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at com.opera.core.systems.scope.stp.StpConnectionListener.start(StpConnectionListener.java:80)
at com.opera.core.systems.scope.stp.StpConnectionListener.<init>(StpConnectionListener.java:53)
at com.opera.core.systems.scope.stp.StpThread.<init>(StpThread.java:44)
at com.opera.core.systems.ScopeServices.<init>(ScopeServices.java:175)
at com.opera.core.systems.OperaDriver.createScopeServices(OperaDriver.java:230)
... 27 more
I downloaded the OperaDriver from https://github.com/operasoftware/operadriver/ and tried to run the simple/Example.java
But I always get an exception "java.net.BindException: Address already in use"?
I don't understand how this BindException can occur? How do I found out which port is already occupied? It is not printed out in the stack trace?
Where does the OperaDriver run by default?
Here is the full stack trace:
Jun 29, 2011 10:35:16 AM com.opera.core.systems.OperaDriver <init>
SEVERE: Error initializing OperaDriver with exception
org.openqa.selenium.WebDriverException: java.net.BindException: Address already in use
Build info: version: '2.0rc3', revision: '12536', time: '2011-06-20 18:19:52'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.34.8-0.2-desktop', java.version: '1.6.0_24'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.OperaDriver.createScopeServices(OperaDriver.java:233)
at com.opera.core.systems.OperaDriver.init(OperaDriver.java:192)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:147)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:105)
at ch.adnovum.wci.test.common.DriverFactory.getDriver(DriverFactory.java:132)
at ch.adnovum.wci.test.web.UpAndRunningTest.testCustomerAppOpera(UpAndRunningTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at com.opera.core.systems.scope.stp.StpConnectionListener.start(StpConnectionListener.java:80)
at com.opera.core.systems.scope.stp.StpConnectionListener.<init>(StpConnectionListener.java:53)
at com.opera.core.systems.scope.stp.StpThread.<init>(StpThread.java:44)
at com.opera.core.systems.ScopeServices.<init>(ScopeServices.java:175)
at com.opera.core.systems.OperaDriver.createScopeServices(OperaDriver.java:230)
... 27 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Opera-WebDriver 通过 Scope 协议与 Opera 进行通信:默认情况下,它在端口 7001 上运行。
Opera-WebDriver communicates with Opera over the Scope protocol: by default this runs on port 7001.