[ 
https://issues.apache.org/jira/browse/PDFBOX-4671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16974496#comment-16974496
 ] 

Joerg O. Henne commented on PDFBOX-4671:
----------------------------------------

Hi all. Just a quick heads up, that I am currently unable to pour as much time 
into this issue as I would like.

[~haraldk76]: thanks for your detailed analysis.
 # I agree with your verdict that logging should either go away (debug, info) 
or be replaced with calls to any registered {{IIOReadWarningListener}}s 
(warning, error).
 # I am, however, unsure about the caching. The goal of the caching is to keep 
the full-resolution bitmap around in case someone wants to render both a 
high-resolution page image as well as a down-sampled thumbnail image. While I 
agree that this could be done completely in client code, I am not sure whether 
there are currently any users out there that rely on the current caching 
behavior and/or the option to set the cache implementation.
I am not a big fan of the service-lookup based cache configuration, though. It 
will most likely cause problems with Java 9+ anyway. We'd be better served to 
handle this via a setter in the {{JBIG2ReadParam}}.

[~lpanadero]: while I cannot make any promises about a timely implementation of 
the above changes, I would certainly be happy to review a pull request should 
you be able to spare some time.

Thanks, Jörg

> NoClassDefFoundError: Could not initialize class 
> org.apache.pdfbox.jbig2.JBIG2ImageReader
> -----------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4671
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4671
>             Project: PDFBox
>          Issue Type: Bug
>          Components: JBIG2
>    Affects Versions: 3.0.2 JBIG2
>            Reporter: Luis Panadero Guardeño
>            Assignee: Joerg O. Henne
>            Priority: Major
>         Attachments: jbig2 servlet failcase.tar.gz
>
>
> JBIG2 ImageIO plugin sometimes does a NoClassDefFoundError
> I'm using TwelveMonkeys IIOProviderContextListener to fix the problem of 
> ImageIO with servlets, and additionally doing a 
> {{ImageIO}}.{{scanForPlugins}}(). But this keeps happening randomly. Any idea 
> where could be the problem ?
> This is happening with Tomcat 7  running over Oracle Java 8 (latest version)
>  
> {code:java}
> java.lang.NoClassDefFoundError: Could not initialize class 
> org.apache.pdfbox.jbig2.JBIG2ImageReader
>  at 
> org.apache.pdfbox.jbig2.JBIG2ImageReaderSpi.createReaderInstance(JBIG2ImageReaderSpi.java:117)
>  at 
> javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
>  at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529)
>  at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513)
>  at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:155)
>  at org.apache.pdfbox.filter.JBIG2Filter.decode(JBIG2Filter.java:67)
>  at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:84)
>  at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:175)
>  at 
> org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:241)
>  at 
> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createInputStream(PDImageXObject.java:735)
>  at 
> org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from1Bit(SampledImageReader.java:253)
>  at 
> org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:212)
>  at 
> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:444)
>  at 
> org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:425)
>  at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:1100)
>  at 
> org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:63)
>  at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:869)
>  at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:505)
>  at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:479)
>  at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:152)
>  at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:263)
>  at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:321)
>  at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:243)
>  at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:203)
>  at 
> com.digibis.digiimage.pdf.pdfbox.PdfBoxPdfProcessor.getImageFromDocumentPage(PdfBoxPdfProcessor.java:105){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to