Home Selenium standalone server fails in production mode - Grails
Reply: 1

Selenium standalone server fails in production mode - Grails

Sulteric
1#
Sulteric Published in 2017-12-04 15:10:05Z

I have a web application written using Grails that's failing in production mode when trying to fire up Selenium standalone server.

Here's the error:

 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)

Line 29 is this:

 WebDriver driver = new RemoteWebDriver(new URL("http://123.456.78.910:4444/wd/hub"), capabilities)

This works perfectly fine in debug mode. Anyone have any ideas? (IP address hidden for privacy)

DebanjanB
2#
DebanjanB Reply to 2017-12-06 14:34:23Z

Use FirefoxOptions to merge the capabilities through org.openqa.selenium.MutableCapabilities as follows :

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);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300053 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO