title: Which jars should I include in the classpath for apache fop
body: <p>I am getting <code>ClassNotFoundException</code> with <code>Apache-FOP</code> I have included fop.jar in my WEB-INF lib directory in websphere 7.0. I added xmlgraphics-commons-1.4.jar to my lib and then it throws verify error.</p>
  
  <p><code>Caused by: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=org/apache/fop/fo/ElementMappingRegistry, method=findFOMaker(Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Locator;)Lorg/apache/fop/fo/ElementMapping$Maker;, pc=127</code></p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: org.apache.xmlgraphics.image.loader.ImageContext
      at java.lang.ClassLoader.defineClassImpl(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:274)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
      at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:768)
      at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:687)
      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:510)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
      at cat.gis.portal.servicehistory.controllers.EquipmentServiceHistoryDetailsViewController.generatePDF(EquipmentServiceHistoryDetailsViewController.java:281)
      at cat.gis.portal.servicehistory.controllers.EquipmentServiceHistoryDetailsViewController.workOrderDetailsView(EquipmentServiceHistoryDetailsViewController.java:205)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:600)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:362)
      at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:349)
      at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleResource(AnnotationMethodHandlerAdapter.java:296)
      at org.springframework.web.portlet.DispatcherPortlet.doResourceService(DispatcherPortlet.java:825)
      ... 119 more
  Caused by: java.lang.ClassNotFoundException: org.apache.xmlgraphics.image.loader.ImageContext
      at java.net.URLClassLoader.findClass(URLClassLoader.java:421)
      at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:652)
      at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
      at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
      at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:540)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:508)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
      at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:508)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
      ... 137 more
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.1"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
  &lt;xsl:output encoding="iso-8859-1" /&gt;
  &lt;xsl:template match ="services"&gt;
      &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
          &lt;fo:layout-master-set&gt;
              &lt;fo:simple-page-master master-name="service"&gt;
                  &lt;fo:region-body&gt;&lt;/fo:region-body&gt;
              &lt;/fo:simple-page-master&gt;
          &lt;/fo:layout-master-set&gt;
  
          &lt;fo:page-sequence master-reference="service"&gt;
              &lt;fo:flow flow-name="xsl-region-body"&gt;
                  &lt;fo:block&gt;
                      &lt;fo:table&gt;
                          &lt;fo:table-body&gt;
                              &lt;fo:table-row&gt;
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Service Id&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Open Date&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Close Date&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;                                    
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Order Status&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;                                    
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Description&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;
                                  &lt;fo:table-cell border="solid 1px black" 
                                  text-align="center" font-weight="bold"&gt;
                                      &lt;fo:block&gt;Repair Cost&lt;/fo:block&gt;
                                  &lt;/fo:table-cell&gt;
                              &lt;/fo:table-row&gt;
                              &lt;xsl:for-each select="./service"&gt;
                                  &lt;fo:table-row&gt;
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="serviceId" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="openDate" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="closeDate" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;                                
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="orderStatus" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="description" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;
                                      &lt;fo:table-cell border="solid 1px bold" text-align="center"&gt;
                                          &lt;fo:block&gt;&lt;xsl:value-of select="repairCost" /&gt;&lt;/fo:block&gt;
                                      &lt;/fo:table-cell&gt;
                                  &lt;/fo:table-row&gt;
                              &lt;/xsl:for-each&gt;
                          &lt;/fo:table-body&gt;
                      &lt;/fo:table&gt;
                  &lt;/fo:block&gt;
              &lt;/fo:flow&gt;
          &lt;/fo:page-sequence&gt;
      &lt;/fo:root&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>