using selenium in a web service throws java.lang.NoClassDefFoundError exception -


i tried implemented web service dynamic web project. added selenium-server-standalone-2.32.0.jar file buildpath, added web-inf/lib folder. used web service wizard generate web service project. @ start of wizard displayed pop-up warning read:

the service class "test.eko3.testeko3" not comply 1 or more requirements of jax-rpc 1.1 specification, , may not deploy or function correctly. value type "org.openqa.selenium.webdriver" used via service class "test.eko3.testeko3" not have public default constructor. chapter 5.4 of jax-rpc 1.1 specification requires value type have public default constructor, otherwise jax-rpc 1.1 compliant web service engine may unable construct instance of value type during deserialization. field or property "windowhandles" on value type "org.openqa.selenium.webdriver" used via service class "test.eko3.testeko3" has data type, "java.util.set", not supported jax-rpc 1.1 specification. instances of type may not serialize or deserialize correctly. loss of data or complete failure of web service may result. 

i clicked ok , generated web server , client , displayed client in eclipse's browser. when entered parameters , clicked invoke displayed exception in result section:

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  

since added selenium jar both buildpath , web-inf/lib folder i'm not sure why can't find class. code server below:

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 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 , click     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); //              } { //                  out.close(); //              }     //closing browser     driver.close();      return page;      }      public static void waitforpageloaded(webdriver driver) {          expectedcondition<boolean> expectation = new     expectedcondition<boolean>() {            public boolean apply(webdriver driver) {              return ((javascriptexecutor)driver).executescript("return document.readystate").equals("complete");            }          };          wait<webdriver> wait = new webdriverwait(driver,30);          try {                  wait.until(expectation);          } catch(throwable error) {                  system.out.println("exception yavrum");          }     }   } 

can please tell me cause of this? missing jar file selenium depends on? appreciated.

maybe using standalone jar not web projects. see http://me-ol-blog.blogspot.co.il/2013/07/using-selenium-in-java-dynamic-web.html


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -