MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Linux: can not start the driver #186

Closed a03201 closed 7 years ago

a03201 commented 7 years ago

org.openqa.selenium.WebDriverException: Could not launch browser.\nBuild info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'\nSystem info: host: '1958dd525577', ip: '172.17.0.123', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.11.1.el7.x86_64', java.version: '1.8.0_51'\nDriver info: driver.version: JBrowserDriver

a03201 commented 7 years ago

Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: '1958dd525577', ip: '172.17.0.123', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.11.1.el7.x86_64', java.version: '1.8.0_51' Driver info: driver.version: JBrowserDriver at com.machinepublishers.jbrowserdriver.Util.handleException(Util.java:140) at com.machinepublishers.jbrowserdriver.JBrowserDriver.(JBrowserDriver.java:318) at edu.uci.ics.crawler4j.crawler.WebCrawler.getAjaxContentData(WebCrawler.java:461) at edu.uci.ics.crawler4j.crawler.WebCrawler.processPage(WebCrawler.java:395) at edu.uci.ics.crawler4j.crawler.WebCrawler.run(WebCrawler.java:283) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Could not launch browser. ... 5 more

hollingsworthd commented 7 years ago

It's a little hard to know what's going wrong without more info. You can run integration tests by calling JBrowserDriver.test() which will return a list of error messages--or an empty list if tests pass. Running that would isolate any possible complications introduced by crawler4j. Similarly you can execute the main method in com.machinepublishers.jbrowserdriver.diagnostics.Test as a Java application.

Overall the failure is related to launching a child JRE process.

a03201 commented 7 years ago

I found the cookiemanager not found. It's so weird. Even I add maven support for it. Still report not found.

[2016-08-29T02:56:10.740] java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager [2016-08-29T02:56:10.741] at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:74) [2016-08-29T02:56:10.741] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager [2016-08-29T02:56:10.741] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [2016-08-29T02:56:10.742] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [2016-08-29T02:56:10.742] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) [2016-08-29T02:56:10.742] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [2016-08-29T02:56:10.742] ... 1 more [2016-08-29T02:56:10.964] java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager [2016-08-29T02:56:10.965] at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:74) [2016-08-29T02:56:10.965] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager [2016-08-29T02:56:10.965] at java.net.URLClassLoader.findClass(URLClassLoader.java:381) [2016-08-29T02:56:10.965] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [2016-08-29T02:56:10.966] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) [2016-08-29T02:56:10.966] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

a03201 commented 7 years ago

I found your comments on cookie manager. I am using the openJDK on server, it should be cause for cookie manager problems. Is there any way to go arround it?

a03201 commented 7 years ago

I try run it under the Oracle Jvm instead of OpenJDK. However it's very weird: java version "1.8.0_102" -- Java(TM) SE Runtime Environment (build 1.8.0_102-b14) -- Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) Under this JVM, it still can not found cookie manager.

However when in the develop machine: 1.8.0_91-b14 It's ok. So strange!!!!!

hollingsworthd commented 7 years ago

Maybe openjfx is not installed on the server?

a03201 commented 7 years ago

ok. thanks.