You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by donli <do...@gmail.com> on 2015/06/05 16:46:21 UTC

POI stop no response and errors

I'm using apache-poi to parse a lot of word documents. I have the following
code.

URL u = new URL(fileName);

// given a url open a connection
URLConnection c = u.openConnection();

// set the connection timeout to 5 seconds
c.setConnectTimeout(5 * 1000);

System.out.println("Start to parse DOC file.");
POIFSFileSystem fs = new POIFSFileSystem(u.openStream());
System.out.println("File opened.");
I run this code in a loop, open the word document and parse the document.
Sometimes the code stopped at new POIFSFileSystem(u.openStream()) without
any warnings and errors for several hours. I have to restart the program.

What's the possible reason?



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/POI-stop-no-response-and-errors-tp5719051.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: POI stop no response and errors

Posted by donli <do...@gmail.com>.
Thanks Nick!



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/POI-stop-no-response-and-errors-tp5719051p5719057.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: POI stop no response and errors

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 5 Jun 2015, donli wrote:
> System.out.println("Start to parse DOC file.");
> POIFSFileSystem fs = new POIFSFileSystem(u.openStream());
> System.out.println("File opened.");
> I run this code in a loop, open the word document and parse the document.
> Sometimes the code stopped at new POIFSFileSystem(u.openStream()) without
> any warnings and errors for several hours. I have to restart the program.

Try with NPOIFSFileSystem. Also, try spooling the remote stream to a file 
and read from there, in case it's your remote server timing out

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org