Selenium独立服务器未启动 [英] Selenium standalone server not starting

查看:205
本文介绍了Selenium独立服务器未启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的VPS上启动硒独立服务器时遇到麻烦

I'm running into trouble while starting selenium standalone server on my VPS

root@PIV:/usr/share/nginx/pivdev/tests# java -jar selenium-server.jar 

输出:

21:53:08.857 INFO - Launching a standalone Selenium Server
21:53:08.911 INFO - Java: Oracle Corporation 24.79-b02
21:53:08.914 INFO - OS: Linux 3.13.0-52-generic amd64
21:53:08.945 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
21:53:09.070 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
21:53:09.071 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, browserName=MicrosoftEdge, version=}] does not match the current platform LINUX
21:53:09.071 INFO - Driver class not found: com.opera.core.systems.OperaDriver
21:53:09.071 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered

此后没有更多输出. 在本地,相同的命令就像一个超级按钮一样工作.任何提示如何解决此问题?

No more output after that. Locally the same command works like like a charm. Any hint how to fix this issue ?

Java

root@PIV:/usr/share/nginx/pivdev/tests# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

更新1

该服务根本不在任何端口上运行

The service is not running on any port at all

Netstat输出

root@PIV:~# netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      898/sshd        
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1247/sendmail: MTA:
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      974/mysqld      
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      1247/sendmail: MTA:
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1005/nginx      
tcp        0      0 0.0.0.0:81              0.0.0.0:*               LISTEN      1005/nginx      
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      496/vsftpd      
tcp6       0      0 :::22                   :::*                    LISTEN      898/sshd        
tcp6       0      0 :::35484                :::*                    LISTEN      2036/java       
tcp6       0      0 :::50920                :::*                    LISTEN      2036/java       
tcp6       0      0 :::8080                 :::*                    LISTEN      2036/java  

更新2

好的,这里的主要问题是硒服务器在启动时卡住了,我不知道为什么.我销毁了我的VPS机器并从头开始.硒服务器启动一次,在我停止并再次启动后,问题发生了(并在重新启动后仍然存在).有时即使第一次尝试也不起作用.

Ok, the main issue here is that selenium server is getting stuck on startup, and I dont know why. I destroyed my VPS machine and started from scratch. The selenium server booted up once, after I stopped and started again the issue happened(And persists after reboot). Sometimes it doesnt works even on the first try.

我不确定是Java问题还是Selenium服务器问题还是我的VPS主机问题.

I'm not sure if its either a java problem or selenium server problem or my VPS host problem.

推荐答案

简短的故事:

Selenium使用/dev/random(不知道为什么,不问),它正在等待足够的熵来生成随机数.

Selenium uses /dev/random (don't know why, dont ask) and it was waiting for enough entropy to generate the random number.

修复

只需在启动硒时添加参数:-Djava.security.egd=file:///dev/urandom switch,您就很好了

Just add the parameter when starting selenium: -Djava.security.egd=file:///dev/urandom switch and you're good to go

这篇关于Selenium独立服务器未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆