简体   繁体   English

Raspberry Pi 4 的 Java、Selenium、Debian,geckodriver 错误打印垃圾

[英]Java, Selenium, Debian for Raspberry Pi 4, geckodriver error prints garbage

Im making a Java program that uses Selenium to access webpages and retrieve data, it works on Windows, pure Debian and Ubuntu but when I run it on my RPI4 with Debian for Raspberry Pi 4, the geckodriver gives cryptic errors and the program crashes. Im making a Java program that uses Selenium to access webpages and retrieve data, it works on Windows, pure Debian and Ubuntu but when I run it on my RPI4 with Debian for Raspberry Pi 4, the geckodriver gives cryptic errors and the program crashes.

The errors are as follows:错误如下:

/usr/local/bin/geckodriver: 2: /usr/local/bin/geckodriver: YM9sHIiHMIi԰: not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: Syntax error: end of file unexpected (expecting ")")
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: 6: not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: : not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: : not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: 6: not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: $/: not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: GNUu¬wת,岹PXH: not found
/usr/local/bin/geckodriver: 1: /usr/local/bin/geckodriver: ELF: not found
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:29555
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'raspy', ip: '192.168.1.33', os.name: 'Linux', os.arch: 'aarch64', os.version: '5.9.0-0.bpo.5-arm64', java.version: '11.0.9.1'
Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
        at net.ddns.creepercrack.Main.main(Main.java:40)
Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:29555
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:165)
        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
        at okhttp3.RealCall.execute(RealCall.java:77)
        at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
        ... 5 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at okhttp3.internal.platform.Platform.connectSocket(Platform.java:129)
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:245)
        ... 27 more

The program also creates this file: ''$'\001\022\002''@@'$'\230\204''y@8'$'\a''@'$'\035\032\001\005''@@t'$'\202''6t'$'\202''6' , but I did not program that myself.程序还会创建这个文件: ''$'\001\022\002''@@'$'\230\204''y@8'$'\a''@'$'\035\032\001\005''@@t'$'\202''6t'$'\202''6' ,但我自己没有编程。 This does not happen when the program works, only when it crashes.这在程序运行时不会发生,只有在它崩溃时才会发生。

It may be that it just does not work but I would like to know the answer.可能是它不起作用,但我想知道答案。 The geckodriver is correcly in the PATH inside the program and is executable Also, firefox-esr and default-jre. geckodriver 正确地位于程序内部的 PATH 中,并且是可执行的 此外,firefox-esr 和 default-jre。

Thank you!谢谢!

  1. With regard to the "garbage" being printed when using关于使用时打印的“垃圾”
    'gekodriver', perhaps it is because its not meant for the platform 'gekodriver',也许是因为它不适合平台
    (hardware + operating_system) you are using? (硬件+操作系统)你正在使用?
  2. With regard to关于

Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:29555 Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'raspy', ip: '192.168.1.33', os.name: 'Linux', os.arch: 'aarch64', os.version: '5.9.0-0.bpo.5-arm64', java.version: '11.0.9.1'线程“主”org.openqa.selenium.WebDriverException 中的异常:java.net.ConnectException:无法连接到 localhost/0:0:0:0:0:0:0:1:29555 构建信息:版本:'未知',修订:'未知',时间:'未知'系统信息:主机:'raspy',ip:'192.168.1.33',os.name:'Linux',os.arch:'aarch64',os.version: '5.9.0-0.bpo.5-arm64',java.版本:'11.0.9.1'

That would indicate that there is nothing listening on 29555 on tcp6 ip protocol.这表明 tcp6 ip 协议上的 29555 上没有任何监听。

Above are just guesses that you can try looking into until someone better informed comes along.以上只是猜测,您可以尝试调查,直到有更知情的人出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM