zhihongzzh / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

IOException when reading certain CSS files #204

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build example program: 
https://github.com/flyingsaucerproject/flyingsaucer/blob/master/flying-saucer-ex
amples/src/main/java/PDFRender.java
2. Run example program on: http://twitter.github.com/bootstrap/
3. IOException: stream closed 

What is the expected output? What do you see instead?
A PDF with some styling. A PDF with no styling

What version of the product are you using? On what operating system?
9.0.1 on Unbuntu 12.04

Please provide any additional information below.
I get the following stack trace:

java.io.IOException: Stream closed
        at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at org.xhtmlrenderer.css.parser.Lexer.zzRefill(Lexer.java:1634)
        at org.xhtmlrenderer.css.parser.Lexer.yylex(Lexer.java:1865)
        at org.xhtmlrenderer.css.parser.CSSParser.next(CSSParser.java:1807)
        at org.xhtmlrenderer.css.parser.CSSParser.la(CSSParser.java:1819)
        at org.xhtmlrenderer.css.parser.CSSParser.stylesheet(CSSParser.java:159)
        at org.xhtmlrenderer.css.parser.CSSParser.parseStylesheet(CSSParser.java:89)
        at org.xhtmlrenderer.context.StylesheetFactoryImpl.parse(StylesheetFactoryImpl.java:78)
        at org.xhtmlrenderer.context.StylesheetFactoryImpl.parse(StylesheetFactoryImpl.java:95)
        at org.xhtmlrenderer.context.StylesheetFactoryImpl.getStylesheet(StylesheetFactoryImpl.java:174)
        at org.xhtmlrenderer.context.StyleReference.readAndParseAll(StyleReference.java:123)
        at org.xhtmlrenderer.context.StyleReference.setDocumentContext(StyleReference.java:107)
        at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:176)
        at org.xhtmlrenderer.pdf.ITextRenderer.setDocument(ITextRenderer.java:143)

Original issue reported on code.google.com by philip.c...@gmail.com on 4 Aug 2012 at 5:01

GoogleCodeExporter commented 8 years ago
After playing around with this more, I think it might be related to the native 
client resource resolving. The stream is being forced closed before anyway work 
is done (possibly due to the fact that a resource is not present or connection 
refused on the network).

Original comment by philip.c...@gmail.com on 4 Aug 2012 at 9:16

GoogleCodeExporter commented 8 years ago
Have you found any solution to this problem? I too get this when included 
bootstrap css in a xhtml file and the use flying-saucer to generate pdf.

Original comment by pichd...@gmail.com on 30 Apr 2014 at 6:14