title: using selenium in a web service throws java.lang.NoClassDefFoundError exception
body: <p>I tried to implemented a web service from a dynamic web project. I added the selenium-server-standalone-2.32.0.jar file to the buildpath, then I also added it to the WEB-INF/lib folder. Then I used the web service wizard to generate the web service from the project. At the start of the wizard it displayed a pop-up warning that read:</p>
  
  <pre><code>The service class "test.eko3.TestEko3" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
  The value type "org.openqa.selenium.WebDriver" used via the service class "test.eko3.TestEko3" does not have a public default constructor. Chapter 5.4 of the JAX-RPC 1.1 specification requires a value type to have a public default constructor, otherwise a JAX-RPC 1.1 compliant Web service engine may be unable to construct an instance of the value type during deserialization.
  The field or property "windowHandles" on the value type "org.openqa.selenium.WebDriver" used via the service class "test.eko3.TestEko3" has a data type, "java.util.Set", that is not supported by the JAX-RPC 1.1 specification. Instances of the type may not serialize or deserialize correctly. Loss of data or complete failure of the Web service may result.
  </code></pre>
  
  <p>I clicked ok and it generated the web server and the client and displayed the client in the eclipse's browser. But when I entered the parameters and clicked invoke it displayed this exception in the result section:</p>
  
  <pre><code>Exception: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver; nested exception is: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver Message: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver; nested exception is: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver 
  </code></pre>
  
  <p>Since I added the selenium jar into both the buildpath and the WEB-INF/lib folder I'm not sure why it can't find the class. The code for the server is below:</p>
  
  <pre><code>package test.eko3;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.JavascriptExecutor;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.support.ui.ExpectedCondition;
  import org.openqa.selenium.support.ui.Wait;
  import org.openqa.selenium.support.ui.WebDriverWait;
  
  public class TestEko3 {
  public String Ekobilet(String from, String to, String date) {
  
      //Firefox browser instantiation
      WebDriver driver = new FirefoxDriver();
  
      //Loading the URL
      driver.get("http://www.amadeusepower.com/trek/portals/trek/default.aspx?Culture=en-US");
  
  
      WebElement radioOneway = driver.findElement(By.id("ctl00_ctl00_ctl00_cph1_cph1_QuickSearchAll1_QuickFlightSearchControl1_rbFlightType_1"));
      radioOneway.click();
  
      waitForPageLoaded(driver);
  
  
      WebElement fromText = driver.findElement(By.id("ctl00_ctl00_ctl00_cph1_cph1_QuickSearchAll1_QuickFlightSearchControl1_txtSearch_txtFrom"));
      fromText.clear();
      fromText.sendKeys(from); 
  
  
      WebElement toText = driver.findElement(By.id("ctl00_ctl00_ctl00_cph1_cph1_QuickSearchAll1_QuickFlightSearchControl1_txtSearch_txtTo"));
      toText.sendKeys(to); 
  
  
      WebElement dateText = driver.findElement(By.id("ctl00_ctl00_ctl00_cph1_cph1_QuickSearchAll1_QuickFlightSearchControl1_txtDepartureDate_txtDate"));
      dateText.sendKeys(date); 
  
      //Sign in button identification and click it
      WebElement searchbutton = driver.findElement(By.id("ctl00_ctl00_ctl00_cph1_cph1_QuickSearchAll1_QuickFlightSearchControl1_btnSearch"));
      searchbutton.click();
  
      String page = driver.getPageSource();
  
  //      Writer out = new BufferedWriter(new OutputStreamWriter(
  //                  new FileOutputStream("ekobiletselenium.html"), "UTF-8"));
  //              try {
  //                  out.write(page);
  //              } finally {
  //                  out.close();
  //              }
      //Closing the browser
      driver.close();
  
      return page;
  
      }
  
      public static void waitForPageLoaded(WebDriver driver) {
  
          ExpectedCondition&lt;Boolean&gt; expectation = new
      ExpectedCondition&lt;Boolean&gt;() {
             public Boolean apply(WebDriver driver) {
               return ((JavascriptExecutor)driver).executeScript("return document.readyState").equals("complete");
             }
           };
  
          Wait&lt;WebDriver&gt; wait = new WebDriverWait(driver,30);
           try {
                   wait.until(expectation);
           } catch(Throwable error) {
                   System.out.println("exception yavrum");
           }
      } 
  
  }
  </code></pre>
  
  <p>Can someone please tell me the cause of this? Am I missing a jar file that selenium depends on? Any help would be appreciated.</p>