Re: java.io.IOException
"Okaru, Peter" <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <285664C5E923CE4DAD2146B673F5A4660548D557@EAHQ-CSMB8.rws.ad.ea.com> |
Everyone needs to use Apache http client. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of James Abley Sent: Friday, March 30, 2007 2:28 PM To: [email protected] Subject: Re: [Httpunit-develop] java.io.IOException On 30/03/07, [email protected] <[email protected]> wrote: > > > > ----- Original Nachricht ---- > Von: James Abley <[email protected]> > An: Discussion of use and development of HttpUnit <[email protected]> > Datum: 29.03.2007 23:38 > Betreff: Re: [Httpunit-develop] java.io.IOException > > > It looks like the server responded with a malformed response. Can you > > reliably reproduce this and maybe use a network traffic sniffer to > > monitor it at a lower level in the networking stack? > which program you recommend ? > > So presumably you can reliably reproduce the problem? With stuff like this, you're usually better off looking as high up the stack as you can, otherwise the volumes of data get scary; i.e. don't try a packet sniffer straight away; maybe try something a bit higher up the stack first. What you use might depend on what OS you're using - Ethereal is good, TCPWatch, etc. Google can tell you more. > > On 28/03/07, [email protected] <[email protected]> wrote: > > > why I get this error: > > > Test: > > > import com.meterware.httpunit.*; > > > > > > import junit.framework.*; > > > > > > > > > /** > > > * An example of testing servlets using httpunit and JUnit. > > > **/ > > > public class ExampleTest extends TestCase { > > > > > > > > > public static void main(String args[]) { > > > junit.textui.TestRunner.run( suite() ); > > > } > > > > > > > > > public static Test suite() { > > > > > > return new TestSuite( ExampleTest.class ); > > > } > > > > > > > > > public ExampleTest( String name ) { > > > super( name ); > > > } > > > > > > > > > /** > > > * Verifies that the welcome page has exactly one form, with the > > single parameter, "name" > > > **/ > > > public void testWelcomePage() throws Exception { > > > HttpUnitOptions.setExceptionsThrownOnErrorStatus(false); > > > HttpUnitOptions.setExceptionsThrownOnScriptError(false); > > > HttpUnitOptions.setScriptingEnabled(false); > > > HttpUnitOptions.setLoggingHttpHeaders(true); > > > HttpUnitOptions.setCheckContentLength(false); > > > > > > WebConversation conversation = new WebConversation(); > > > WebRequest request = new GetMethodWebRequest( "http://www.is24.de" > > ); > > > WebResponse response=null; > > > response = conversation.getResponse( request ); > > > WebForm forms[] = response.getForms(); > > > System.out.println(forms.length); > > > } > > > } > > > Error: > > > ........ > > > Connecting to imps.immobilienscout24.de > > > Sending:: GET > > http://imps.immobilienscout24.de/?adiframe|2.0|247|65095|1|12|;KEY=home; targ > > et=_blank; > > > Sending:: User-Agent: httpunit/1.5 > > > Sending:: Accept-Encoding: gzip > > > > > > Received from > > http://imps.immobilienscout24.de/?adiframe|2.0|247|65095|1|12|;KEY=home; targ > > et=_blank; > > > Header:: null > > > E > > > Time: 4,195 > > > There was 1 error: > > > 1) testWelcomePage(ExampleTest)java.io.IOException > > > at > > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec tion > > .java:602) > > > at > > java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272) > > > at > > com.meterware.httpunit.HttpWebResponse.readResponseHeader(HttpWebRespons e.ja > > va:162) > > > at > > com.meterware.httpunit.HttpWebResponse.readHeaders(HttpWebResponse.java: 200) > > > > > at > > com.meterware.httpunit.HttpWebResponse.<init>(HttpWebResponse.java:56) > > > at > > com.meterware.httpunit.HttpWebResponse.<init>(HttpWebResponse.java:67) > > > at > > com.meterware.httpunit.WebConversation.newResponse(WebConversation.java: 76) > > > at > > com.meterware.httpunit.WebWindow.getResource(WebWindow.java:164) > > > at > > com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:128) > > > at > > com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:184) > > > at > > com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:252) > > > at > > com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:485) > > > at > > com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:146) > > > at > > com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130) > > > at > > com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121) > > > at > > com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:144) > > > at > > com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130) > > > at > > com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121) > > > at > > com.meterware.httpunit.WebClient.getResponse(WebClient.java:113) > > > at ExampleTest.testWelcomePage(ExampleTest.java:42) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39 > > ) > > > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl > > .java:25) > > > at ExampleTest.main(ExampleTest.java:14) > > > Caused by: java.net.SocketException: Unexpected end of file from server > > > at > > sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:822) > > > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:711) > > > at > > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec tion > > .java:635) > > > at > > sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnec tion > > .java:1530) > > > at > > com.meterware.httpunit.HttpWebResponse.loadHeaders(HttpWebResponse.java: 213) > > > > > at > > com.meterware.httpunit.HttpWebResponse.readHeaders(HttpWebResponse.java: 198) > > > > > ... 32 more > > > > > > FAILURES!!! > > > Tests run: 1, Failures: 0, Errors: 1 > > > > > > > > > > > > > > > > > > Cheers > > > H.Braun > > > > > > ------------------------------------------------------------------------ - > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V > > > _______________________________________________ > > > Httpunit-develop mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/httpunit-develop > > > > > > > ------------------------------------------------------------------------ - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V > > _______________________________________________ > > Httpunit-develop mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/httpunit-develop > > > > Cheers > H.Braun > > ------------------------------------------------------------------------ - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V > _______________________________________________ > Httpunit-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/httpunit-develop > ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V _______________________________________________ Httpunit-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/httpunit-develop ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV