pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: multi-thread bug
Date Mon, 23 May 2016 15:03:19 GMT
This is a known JDK bug in the ICC colour space static initializer. Try doing something minimal
with PDFBox on the main thread so that the PDICCBased static initializer runs there. After
that's happened hopefully your thread pool code will work.

-- John

> On 23 May 2016, at 01:08, 风云天空 <1010800216@qq.com> wrote:
> 
> in my project using spring,we use pdf-box with one PDDocument and one PDFRenderer for
one pdf document,then I encounter problem with call renderImageWithDPI:
> 
> 
> java.lang.NullPointerException
>    at sun.java2d.cmm.ProfileDeferralMgr.activateProfiles(ProfileDeferralMgr.java:93)
>    at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:775)
>    at java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:1013)
>    at org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.loadICCProfile(PDICCBased.java:119)
>    at org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.<init>(PDICCBased.java:89)
>    at org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.create(PDColorSpace.java:182)
>    at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:172)
>    at org.apache.pdfbox.pdmodel.PDResources.getColorSpace(PDResources.java:142)
>    at org.apache.pdfbox.contentstream.operator.color.SetNonStrokingColorSpace.process(SetNonStrokingColorSpace.java:41)
>    at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:815)
>    at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
>    at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
>    at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
>    at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:189)
>    at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:208)
>    at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:139)
>    at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:80)
>    at com.xiaojukeji.training.admin.docparser.PdfExtractor.getFirstImage(PdfExtractor.java:128)
>    at com.xiaojukeji.training.admin.docparser.PdfExtractor$Job.run(PdfExtractor.java:187)
>    at com.xiaojukeji.training.admin.docparser.BlockThreadPool$Worker.run(BlockThreadPool.java:53)
>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>    at java.lang.Thread.run(Thread.java:745)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message