Hi All,

I searched the archive and found similar problems to this
one.  But the solutions do not work for me (for some reason).

Here is the error that I am getting:

2002-11-05 14:11:17,978 HttpProcessor[9081][3] ERROR root - Root element must 
be root, not (none):glossary
org.apache.fop.apps.FOPException: Root element must be root, not (none):glossary
        at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)
        at 
org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:575)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
        at org.apache.fop.apps.Driver.render(Unknown Source)
        ...

This is done with the standard "glossary" example that comes
with the FOP package.  When I run this from the command line, I
have no problems.  When I run it from inside a servlet, I get the
above error.

My example code:
    try {
      org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver ();
      driver.setLogger(new org.apache.avalon.framework.logger.ConsoleLogger ());
      driver.setRenderer (org.apache.fop.apps.Driver.RENDER_PDF);
      org.apache.fop.apps.InputHandler inputHandler = new 
org.apache.fop.apps.XSLTInputHandler(new java.io.File 
("/home/dvdm/java/fop-0.20.4/docs/examples/markers/glossary.xml"), new 
java.io.File ("/home/dvdm/java/fop-0.20.4/docs/examples/markers/glossary.xsl"));
      org.xml.sax.XMLReader parser = inputHandler.getParser();
      driver.setOutputStream(new 
java.io.FileOutputStream("/home/dvdm/tmp/glossary.pdf"));
      driver.render(parser, inputHandler.getInputSource());
    } catch (java.lang.Exception vException) {
      com.telimatrix.OutrixServer.mLogger.error (vException.getMessage (), 
vException);
    }

I am using:
- fop-0.20.4
- jakarta-tomcat-4.0.1
- java version "1.3.0"
- Linux RedHat

Is there anyone that can help?


Reply via email to