I'm using fop 0.20.4 in a servlet which runs on wls
6.1. We create pdfs which consist of text and gifs.
The gif images are located in a jar file which is
under WEB-INF/lib of the war file. I'm retrieving the
URL of the gif with
Thread.getCurrentThread().getContextClassLoader().getResource("logo.gif")
The returned url is used in the 'src' attribute of the
'fo:external-graphic' tag:
<fo:external-graphic
src="zip:C:/apps/Tip210/cs/websrv/bin/wls615/wlserver6.1/config/dochelper_2005/applications/.wlnotdelete/wlap61515/WEB-INF/_tmp_war_dochelper_2005_dochelper_2005_server_dochelpertest/WEB-INF/lib/image
s61077.jar!/images/logo.gif">
</fo:external-graphic>
While rendering the following error is reported:
Error in XObject : Error while loading image
zip:C:/apps/Tip210/cs/websrv/bin/wls615/wlserver6.1/config/dochelper_2005/applications/.wlnotdelete/wlap61515/WEB-INF/_tmp_war_dochelper_2005_dochelper_2005_server_dochelpertest/WEB-INF/lib/image
s61077.jar!/images/logo.gif : class
java.lang.NullPointerException - null
The NullPointerException is thrown by the following
code in the method loadImage() of the class
org.apache.fop.image.GifImage:
ImageProducer ip =
(ImageProducer)this.m_href.getContent()
I tested the same with gifs which reside under the
document root of the war file. In this case i retrieve
the url with
getServletContext().getResource("logo.gif")
The error is the same. With jpegs it works fine. The
loadImage() method of org.apache.fop.image.JpegImage
is loading the jpeg with an input stream. I don't know
if this error only occurs in WLS, but i suggest to
also use input streams in the loadImage() method of
GifImage.
regards,
Damir
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]