Gauge + Selenium | AfterSuite: java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/Kernel32

328 views
Skip to first unread message

rodrigo...@gmail.com

unread,
Feb 5, 2018, 6:02:46 AM2/5/18
to getgauge
Hi,

I am trying to run Gauge + Selenium. Everything looks fine, except this AfterSuite message that I get after all executions. I did not explicitly implemented an AfterSuite method. I built the project using the java_maven_selenium plugin.

I tried to run the example project that is available on Github (https://github.com/getgauge-examples/java-maven-selenium), however the same problem occurs there. Here goes the stack trace:


Failed: After Suite
Message: java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/Kernel32
Stack Trace:
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
org.openqa.selenium.os.ProcessUtils.getProcessId(ProcessUtils.java:184)
org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:128)
org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:254)
org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:208)
org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:658)
org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:497)
utils.driver.Driver.closeDriver(Driver.java:22)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.thoughtworks.gauge.execution.MethodExecutor.execute(MethodExecutor.java:38)
com.thoughtworks.gauge.execution.HooksExecutor$TaggedHookExecutor.executeHook(HooksExecutor.java:102)
com.thoughtworks.gauge.execution.HooksExecutor$TaggedHookExecutor.execute(HooksExecutor.java:88)
com.thoughtworks.gauge.execution.HooksExecutor.execute(HooksExecutor.java:45)
com.thoughtworks.gauge.processor.MethodExecutionMessageProcessor.executeHooks(MethodExecutionMessageProcessor.java:65)
com.thoughtworks.gauge.processor.SuiteExecutionEndingProcessor.process(SuiteExecutionEndingProcessor.java:32)
com.thoughtworks.gauge.connection.MessageDispatcher.dispatchMessages(MessageDispatcher.java:91)
com.thoughtworks.gauge.GaugeRuntime.dispatchMessages(GaugeRuntime.java:105)
com.thoughtworks.gauge.GaugeRuntime.access$100(GaugeRuntime.java:37)
com.thoughtworks.gauge.GaugeRuntime$2.run(GaugeRuntime.java:86)
java.lang.Thread.run(Unknown Source)

Does anyone experienced it?

BR,
Rodrigo

Srikanth V

unread,
Feb 5, 2018, 6:19:35 AM2/5/18
to getgauge
HI,


It tries to kill the browser (via webdriver) after end of execution. I guess killing the browser process on windows is causing an issue?

HTH
Srikanth

On Monday, February 5, 2018 at 4:32:46 PM UTC+5:30:

rodrigo...@gmail.com

unread,
Feb 5, 2018, 11:01:22 AM2/5/18
to getgauge
Thanks for the insight, you're right: the template java_maven_selenium creates that @AfterSuite method.

Nevertheless, I still did not get why it complains about a missing dependency, since all dependencies should be managed by Maven...


Rodrigo

Srikanth V

unread,
Feb 5, 2018, 10:22:04 PM2/5/18
to getgauge
Hi,


It looks like there needs to be a reference to jna, I will need to verify if this needs to be done explicitly, or should be managed via maven.

best
Srikanth

On Monday, February 5, 2018 at 9:31:22 PM UTC+5:30:
Reply all
Reply to author
Forward
0 new messages