title: class not found FOP
body: <p>Hi so i am trying to use FOP to turn an xml file into pdf and i keep on running into errors, right now i have the error</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlgraphics/io/ResourceResolver
  at org.apache.fop.apps.FopConfParser.&lt;init&gt;(FopConfParser.java:122)
  at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:132)
  at run.ExampleFO2PDF.main(ExampleFO2PDF.java:62)
  </code></pre>
  
  <p>i have the <em>FOP</em> library in the build path as well as <em>xmlgraphics</em> and <em>commons logging</em> and <em>Avalon framework</em> </p>
  
  <p>This is the code i am trying to run</p>
  
  <pre><code>        import java.io.BufferedOutputStream;
          import java.io.File;
          import java.io.FileNotFoundException;
          import java.io.FileOutputStream;
          import java.io.IOException;
          import java.io.OutputStream;
  
          import javax.xml.transform.Result;
          import javax.xml.transform.Source;
          import javax.xml.transform.Transformer;
          import javax.xml.transform.TransformerConfigurationException;
          import javax.xml.transform.TransformerException;
          import javax.xml.transform.TransformerFactory;
          import javax.xml.transform.sax.SAXResult;
          import javax.xml.transform.stream.StreamSource;
  
          import org.apache.fop.apps.*;
          import org.xml.sax.SAXException;
  
         public class pdf{
          public static void main(String[] args) throws SAXException, IOException, TransformerException
    {
          FopFactory fopFactory = FopFactory.newInstance(new File("."));
                  OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("D:/temp/myfile.pdf")));
                  try {
                    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
                    TransformerFactory factory = TransformerFactory.newInstance();
                    Transformer transformer = factory.newTransformer(); // identity transformer
                    Source src = new StreamSource(new File("D:/temp/test.xml"));
                    Result res = new SAXResult(fop.getDefaultHandler());
                    transformer.transform(src, res);
                  } finally {
                    //Clean-up
                    out.close();
                  }
             }
  
      }
  </code></pre>