The code for JPEG image handling is missing .close() statement for the opened stream. This can lead to "out of file handle" problems especially in environments where fop is embedded in server type applications.
I think this might stem from Apache XML Graphics Commons library. Not sure of the file though.
The affected class is org.apache.fop.image.JpegImage. It is part of fop itself in version 0.20.5. In the method loadImage() the close call of inStream is missing.
resetting P2 open bugs to P3 pending further review