DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11709>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11709

NullPointerException from PDFXObject.output()

           Summary: NullPointerException from PDFXObject.output()
           Product: Fop
           Version: all
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: images
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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 [EMAIL PROTECTED]

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

Reply via email to