RE: [Httpunit-develop] (Kein Thema)
Brought to you by:
russgold
From: Natalie R. <na...@in...> - 2002-03-26 19:20:13
|
Hello, I just had this same problem. I downloaded xalan from apache. Once you unzip the xalan distribution, you will see a bin directory. If you include xml-apis.jar in the classpath, it should work. Good luck! Natalie -----Original Message----- From: htt...@li... [mailto:htt...@li...]On Behalf Of Han...@ao... Sent: Tuesday, March 26, 2002 11:31 AM To: htt...@li... Subject: [Httpunit-develop] (Kein Thema) Hallo! I just wanted to try HttpUnit I get a NoClassDefFoundError java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException at com.meterware.httpunit.HttpWebResponse.addHeader(HttpWebResponse.java:175) at com.meterware.httpunit.HttpWebResponse.loadHeaders(HttpWebResponse.java, Compiled Code) at com.meterware.httpunit.HttpWebResponse.readHeaders(HttpWebResponse.java:141) at com.meterware.httpunit.HttpWebResponse.<init>(HttpWebResponse.java:52) at com.meterware.httpunit.WebConversation.newResponse(WebConversation.java, Compiled Code) at com.meterware.httpunit.WebClient.getResponse(WebClient.java:70) at de.wfb.tests.InsertNewTournamentTest.getResponse(InsertNewTournamentTest.jav a:36) at de.wfb.tests.InsertNewTournamentTest.testLogin(InsertNewTournamentTest.java: 28) at de.wfb.tests.InsertNewTournamentTest.main(InsertNewTournamentTest.java:57) Interactive Session Ended Exception in thread "main" I have Tidy.jar httpunit.jar and xercesImpl.jar in the classpath. I need xerces because I want to parse an xml file to get the data to the test the application with. This is the program package de.wfb.tests; import java.io.*; import org.xml.sax.*; import java.net.*; import com.meterware.httpunit.*; import junit.framework.*; import org.apache.log4j.*; import de.wfb.cs.*; public class InsertNewTournamentTest { public final static String START_URL = "http://localhost:8080/WFB/turnierManager/login.htm"; //for logging private final static Category cat = Category.getInstance("InsertNewTournamentTest"); WebConversation wc; public InsertNewTournamentTest(String name) { //super(name); BasicConfigurator.configure(); wc = new WebConversation(); } public void testLogin() { WebResponse loginPage = getResponse(START_URL); } private WebResponse getResponse(String url) { WebResponse res = null; WebRequest req = new GetMethodWebRequest(url); try { res = wc.getResponse(req); } catch (SAXException sex) { cat.error("SAXException while trying to get response from URL "+ url + "\n" + StackTrace.getString(sex)); //fail("SAXException while trying to get response from URL + "+ url); } catch (MalformedURLException muex) { cat.error("MalformedURLException while trying to get response from URL " + url + "\n" + StackTrace.getString(muex)); //fail("MalformedURLException while trying to get response from URL " +url); } catch (IOException ioex) { cat.error("IOException while trying to get response from URL "+ url + "\n" + StackTrace.getString(ioex)); //fail("IOException while trying to get response from URL + "+ url); } return res; } public static void main(String[] args) { //junit.textui.TestRunner.run(InsertNewTournamentTest.class); InsertNewTournamentTest test = new InsertNewTournamentTest("test"); test.testLogin(); } } I would be very grateful for help. Thanks Hans |