I'm trying to use htmlunit
but it's happening:
*** Environment / Server: WildFly10
When you run the following command:
WebClient webClient = new WebClient(BrowserVersion.FIREFOX_45);
The error happens:
17:34:19,139 WARN [org.jboss.modules] (default task-4) Failed to define class com.gargoylesoftware.htmlunit.html.DomElement in Module "deployment.teste.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link com/gargoylesoftware/htmlunit/html/DomElement (Module "deployment.teste.war:main" from Service Module Loader): org/w3c/dom/ElementTraversal at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78) at org.jboss.modules.Module.loadModuleClass(Module.java:605) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:358) at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:437) . . . Caused by: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: Failed to link com/gargoylesoftware/htmlunit/html/BaseFrameElement (Module "deployment.teste.war:main" from Service Module Loader): Failed to link com/gargoylesoftware/htmlunit/html/HtmlElement (Module "deployment..war:main" from Service Module Loader): Failed to link com/gargoylesoftware/htmlunit/html/DomElement (Module "deployment.sigeap.war:main" from Service Module Loader): org/w3c/dom/ElementTraversal at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 50 more . . . 17:34:19,168 ERROR [io.undertow.request] (default task-4) UT005023: Exception handling request to /teste/pages/teste/teste.jsf: javax.servlet.ServletException: java.lang.NoClassDefFoundError: Failed to link com/gargoylesoftware/htmlunit/html/BaseFrameElement (Module "deployment.teste.war:main" from Service Module Loader): Failed to link
Maven:
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.23</version>
</dependency>