gpt4 book ai didi

selenium - Selenium独立服务器在生产模式下失败-Grails

转载 作者:行者123 更新时间:2023-12-02 15:46:09 25 4
gpt4 key购买 nike

我有一个使用Grails编写的Web应用程序,该应用程序在尝试启动Selenium独立服务器时在生产模式下失败。

这是错误:

 2017-12-04 10:04:52,905 [http-bio-8080-exec-7] ERROR 
errors.GrailsExceptionResolver - ClassNotFoundException occurred when
processing request: [GET] /Diversotron-0.1/api/edit
com.google.common.base.Function. Stacktrace follows:
java.lang.ClassNotFoundException: com.google.common.base.Function
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getDeclaredConstructors(Class.java:1906)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at diversotron.PropotronService.setPropotron(PropotronService.groovy:29)
at diversotron.ApiController.edit(ApiController.groovy:53)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

29行是这样的:
 WebDriver driver = new RemoteWebDriver(new URL("http://123.456.78.910:4444/wd/hub"), capabilities)

这在 Debug模式下工作得很好。谁有想法? (隐藏IP地址以保护隐私)

最佳答案

使用 FirefoxOptions 通过 org.openqa.selenium.MutableCapabilities 合并功能,如下所示:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("...", true);
capabilities.setCapability("...", true);
FirefoxOptions options = new FirefoxOptions();
options.merge(capabilities);
WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), options);

关于selenium - Selenium独立服务器在生产模式下失败-Grails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47636316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com