commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Dever" <jdev...@nortelnetworks.com>
Subject RE: Possible Http Client Problem
Date Wed, 11 Sep 2002 14:18:39 GMT
So a java Error is being thrown from withing the new io package (assume you
are using java1.4).  Its quite weird that the Error is thrown, and without
any apparent message string.

We need a little more help in debugging this.  Can you turn on the debug log
in httpclient, and perhaps catch the error and try to print out any message
with the stack trace?

-Dorg.apache.commons.logging.simplelog.defaultlog=trace 
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog


> -----Original Message-----
> From: Mark R. Diggory [mailto:mdiggory@latte.harvard.edu]
> Sent: Tuesday, September 10, 2002 1:59 PM
> To: commons-dev@jakarta.apache.org
> Subject: Possible Http Client Problem 
> 
> 
> I've been playing witht he CVS Checkout of the Http Client and I'm 
> getting a wierd exception which I've included below. This code worked 
> with the previous version of the Http Client I was using:
> 
> java.lang.Error
> 	at 
> sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:417)
> 	at 
> sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:442)
> 	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at 
> org.apache.xerces.readers.CharReader.fillCurrentChunk(CharReader.java)
> 	at 
> org.apache.xerces.readers.AbstractCharReader.slowLoadNextChar(
> AbstractCharReader.java)
> 	at 
> org.apache.xerces.readers.AbstractCharReader.scanQName(Abstrac
> tCharReader.java)
> 	at 
> org.apache.xerces.framework.XMLDocumentScanner.scanElementType
> (XMLDocumentScanner.java)
> 	at 
> org.apache.xerces.framework.XMLDocumentScanner.access$1(XMLDoc
> umentScanner.java)
> 	at 
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatch
> er.dispatch(XMLDocumentScanner.java)
> 	at 
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDo
> cumentScanner.java)
> 	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java)
> 	at com.icl.saxon.om.Builder.build(Builder.java:258)
> 	at com.icl.saxon.Controller.transform(Controller.java:925)
> 
> 
> I'm using the InputStream from method.getContentAsStream() in 
> a JAXP transform like this:
> 
> /* SNIP */
> 
> URL url = new 
> URL("http://vdc.fas.harvard.edu/VDC/Repository/0.1/Access?name
=http://purl.thedata.org/VDC/0.1/PURL/1.1.2/06635"> );
> 
> HttpConnection connection = new HttpConnection(url.getHost(),80);
> GetMethod method = new GetMethod(url.getPath());
> method.setQueryString(url.getQuery());
> 
> int state = method.execute(new HttpState(), connection);
> 
> if(state != 200){
>     out.println("<p>State = "+ state+" Reason = " + 
> method.getStatusText()+"</p>");
> }else{
>      TransformerFactory tfactory  = TransformerFactory.newInstance();
>      Templates templates = tfactory.newTemplates(new 
> StreamSource("MainView.xsl"));
>      Transformer transformer = templates.newTransformer();
>      transformer.transform(new 
> StreamSource(method.getResponseBodyAsStream()),new StreamResult(out));
>    
> }
> 
> /* SNIP */
> 
> if I use the following test, I do get the content from the response:
> 
> InputStream in = method.getResponseBodyAsStream();
> 
>     int c;
>     while((c = in.read()) != -1){
>         out.write(c);
>       }
> 
> 
> Any Ideas?
> Mark
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-dev-help@jakarta.apache.org>
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message