0

I prepare a web interface that I could launch the WebDriver. I used servlet.java. I'm using JBoss application server, when I try to run it I receive the following exception

13:39:40,779 ERROR [[ArikTest]] Servlet.service() for servlet ArikTest threw exception java.lang.ClassNotFoundException: org.openqa.selenium.WebDriver at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at ArikTest.doGet(ArikTest.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke (SecurityAssociationValve.java:182) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke (CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process (Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Unknown Source)

UPDATE in response to @xeranos:

Thanks for the quick reply, For your question, By the way I am not using maven. Here is an example of what I want to do:

WebDriver driver = new FirefoxDriver();

Now if I choose right click --> run as java application.

Result: running fine, no problem

BUT when I try to run it from a web application here is an example:

//servlet that receive a submit from a JSP page and i want the webdriver to start

public class HelloServlet extends HttpServlet {

    public void doGet(HttpServletRequest request,
          HttpServletResponse response)

    WebDriver driver = new FirefoxDriver(); 

}

I got the above exception, I used the JBOSS application server and I try to build a JSPnpage that with a click of a button the automation will start.

Is it possible? Am I getting this error because I'm trying to run it above the Jboss server?

3
  • I couldnt find the answer over the web, please helppppp.. it is possible to launch the webdriver (selenium2) through a java application BUT when i try to run it "on a server" on Jboss i receive exceptions . am i missing something ?
    – ArikL
    Jan 9 '12 at 11:50
  • I'm also trying same... getting same error... anyone havin solution for this Jan 12 '18 at 7:23
  • I have edited the information from your answer into the question.
    – Kate Paulk
    Jan 12 '18 at 12:27
1

Did you use Maven when creating Selenium project? Because it looks like you have problems with dependencies. All information you need for creating basic Selenium project can be founded on official documentation.

The easiest way to set up a Selenium 2.0 Java project is to use Maven. Maven will download the Java bindings (the Selenium 2.0 Java client library) and all its dependencies.

1

Your question does not really have anything to do with testing. You need to find someone who can tell you how to include the Selenium client pieces in a war (or ear?) file for JBoss. Perhaps you should try posting your question at stackoverflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.