Fop vs xmlgraphics jar conflict

158 views Asked by At

I have a heavy monolithic guidewire application that has both fop.jar and xmlgraphics-commons.jar. So, I am trying to add an image into a pdf file which is supposed to get rendered with the xmlgraphics-commons.jar. This jar has about 5/6 image renderers available .

Now when I try to print this pdf, the fop jar is used to render some other text onto the pdf and for the image, the xmlgraphics-commons.jar within the fop jar is used. This particular version of the same jar has somehow just 2 image decoders and although I tried to match the format SVG/WMF, it still doesn't work. I get this 'No-ImagePreloader Found' error.This gw application works correctly in my local but when deployed to websphere, it gives this error. Maybe something because of classloader policies.

I cannot use a custom class loader as I don't have control over the code here because the java call happens internally as I am using .pcf files for pdf printing. I examined the fop and xmlgraphics-commons jars and clearly see the difference in the Meta-Inf Services files.

What can I do to get this working ? Maybe there is a simple solution I am missing out on. i can only work with these jars.

I checked some similar questions but they dont help me. Also this below thread might get you understand the crux of my issue better. Apache FOP in a Java Applet - No ImagePreloader found for data

I tried updating the 'org.apache.xmlgraphics.image.loader.spi.ImageLoader' file in meta-inf/services of fop to give the implementation from my external xmlgraphics jar. Got the same error.

If this application had been a maven one, I would have simply excluded this xmlgraphics within fop and used the external one.

0

There are 0 answers