Bug 11709 - NullPointerException from PDFXObject.output()
Summary: NullPointerException from PDFXObject.output()
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: all
Hardware: Other other
: P3 critical
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-14 21:58 UTC by Marty Bergerud
Modified: 2012-04-01 07:00 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marty Bergerud 2002-08-14 21:58:01 UTC
Took 2 months to track this down, in my spare time. 

Test Environment:
Weblogic 5.1 servlet, Using LoadRunner running 10 concurrent users generating 
the same 17 page pdf over and over with no think time. Pdf has a common small 
gif logo on each page, 5 pages include a common complex chart.

Problem:
An occasional NullPointerException was being thrown from the PDFXObject.output
() method.

Root Cause:
The design of the system did not consider concurrent PDFDocuments accessing the 
same FopImage. The FopImage member of the PDFXObject opens and closes an input 
stream from the image url, as well as nulling out other elements. Access to the 
FopImage member (a GifImage) was unsynchronized.
The line that always threw the execption was
int bitMapsSize = fopimage.getBitmapsSize();

Solution:
In the PDFXObject.output() method, added the following line at the beginning of 
the method body.

synchronized(fopimage) {

The NullPointerExceptions disappeared! 

Please no applause, just send money or thanks to mb32@ntrs.com
Comment 1 Oleg Tkachenko 2002-11-19 16:29:53 UTC
Which fop version are you talking about? Anyway, thread-safe problems fixed
already in cvs. Try cvs version (or just wait few days till 0.20.5 is out) and
if it doesn't help, feel free to reopen the bug.
Comment 2 Glenn Adams 2012-04-01 07:00:47 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed