When I try to get to use the getParser in the Fop InputHandler method it is throwing a null pointer somewhere in this method I believe. This is preventing it from generating the pdf. I used this code on the command line app which worked, but when embedding it in a java application it gets hung up at this point. The version of fop being used is 0.20.1 . //render as pdf driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); //get xml file created file_XML = new File(getFileLocation(XMLEXT)); //set where userconfig.xml is located Options op = new Options(); op.loadUserconfiguration("C:\\apachedev\\Fop-0.20.1 \\conf\\userconfig.xml"); //get xsl file file_XSLT = new File(getFileLocation(XSLEXT)); //create the pdf inputHandler = new XSLTInputHandler(file_XML, file_XSLT); parser = inputHandler.getParser(); driver.setOutputStream(new FileOutputStream (getFileLocation(PDFEXT))); driver.render(parser, inputHandler.getInputSource());
The most probably reason is that there is no SAX compatible parser in the classpath. This is a deployment/classpath problem, not with FOP.
Most likely reason changed: It is probably a problem in the style sheet. Xalan-2.0.0 has the nasty habit of throwing NPE for certain stylesheet problems, in particular undeclared namespaces (there are others). This does not rule out other problems.
batch transition to closed remaining pre-FOP1.0 resolved bugs