pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject NullPointerException in multithreading
Date Fri, 18 Mar 2016 19:05:09 GMT
Hello 风云天空,

This is obviously not related to "Spaces are ignored when reading a PDF 
file" so you should have created a new subject line instead of hijacking 
an existing thread by pressing "reply".

I did have the same problem while working on
https://issues.apache.org/jira/browse/PDFBOX-3267

What I did was to change the source code of PDICCBased.java, i.e. change 
this line

awtColorSpace = (ICC_ColorSpace)ColorSpace.getInstance(ColorSpace.CS_sRGB);


to

synchronized(LOG)
  {
        awtColorSpace = 
(ICC_ColorSpace)ColorSpace.getInstance(ColorSpace.CS_sRGB);
}


This is a java bug. I'm undecided whether the change above should be 
committed. But try the change :-)

Tilman



Am 18.03.2016 um 12:02 schrieb 风云天空:
> who can help me
> i get this error in multithreading
> java.lang.NullPointerException
> 	at java.awt.color.ICC_Profile.activateDeferredProfile(ICC_Profile.java:1086)
> 	at java.awt.color.ICC_Profile$1.activate(ICC_Profile.java:742)
> 	at sun.java2d.cmm.ProfileDeferralMgr.activateProfiles(ProfileDeferralMgr.java:95)
> 	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:814)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:471)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:445)
> 	at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
> 	at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:187)
> 	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.liaoyoujin.pdfbox.doc.PdfExtractor.getFirstImage(PdfExtractor.java:109)
> 	at com.liaoyoujin.pdfbox.doc.PdfExtractor$Job.run(PdfExtractor.java:178)
> 	at com.liaoyoujin.thread.pool.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)
> java.util.ConcurrentModificationException
> 	at java.util.Vector$Itr.checkForComodification(Vector.java:1156)
> 	at java.util.Vector$Itr.next(Vector.java:1133)
>


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


Mime
View raw message