Hi,

We have been using FOP 1.0 in WebSphere Portal 7.0 with success.

No we are moving to WebSphere Portal 8.5 and we are experiencing problem.

PDF document creation fails and our application logs the following error:

10/6/16 10:32:33:906 EEST] 0000015a SystemOut     O 
java.lang.ClassCastException: 
org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryPNG incompatible 
with org.apache.xmlgraphics.image.load 
er.spi.ImageLoaderFactory 
[10/6/16 10:32:33:909 EEST] 0000015a SystemOut     O    at 
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.discoverClasspathImplementations(ImageImplRegistry.java:115)
 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:79)
 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:88)
 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.getDefaultInstance(ImageImplRegistry.java:97)
 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.xmlgraphics.image.loader.ImageManager.<init>(ImageManager.java:63) 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.fop.apps.FopFactory.<init>(FopFactory.java:165) 
[10/6/16 10:32:33:910 EEST] 0000015a SystemOut     O    at 
org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:177) 


Reason for the error is the fact that IBM WebSphre Portal loads 
xmlgraphics-commons-2.0.jar and our application is using FOP 1.0 and 
xmlgraphics-commons-1.4.jar. This causes the conflict.

Our application and web modules class loading is set to “parent last” so our 
application should use xmlgraphics-commons-1.4.jar.
We also tried to use isolated shared library to ensure that our application 
uses correct version of the libraries.

We also tried to use FOP 2.0 but it has the same problem with class loading. 
This time portal loads FOP 1.0 and that conflicts:

[10/10/16 15:23:08:004 EEST] 0000013d SystemOut     O 
java.lang.ClassCastException: org.apache.fop.render.pdf.PDFRendererMaker 
incompatible with org.apache.fop.render.AbstractRendererMaker 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.render.RendererFactory.discoverRenderers(RendererFactory.java:420)
 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.render.RendererFactory.<init>(RendererFactory.java:65) 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.apps.FopFactory.<init>(FopFactory.java:97) 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:119) 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.apps.FopFactoryBuilder.build(FopFactoryBuilder.java:122) 
[10/10/16 15:23:08:006 EEST] 0000013d SystemOut     O   at 
org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:158) 


Does anyone know how to solve this problem?     
We are running out of ideas.

Regards,
Pekka Korhonen 

Reply via email to