Upon init (once in the servlet)

    // Gotta configure FOP to know where the base directory is.  Otherwise
    // it will generate errors.  Add a trailing slash so we can use relative
    // paths in our XSL.
    org.apache.fop.configuration.Configuration.put("baseDir", "file:" + dir
            + File.separator);
    org.apache.fop.configuration.Configuration.put("strokeSVGText", new
Boolean(false));



Done for every report request:


public static void createPDF(Document     xslfo,
                             OutputStream pdf)
  throws IOException, FOPException
{
    Driver driver = new Driver(new DocumentInputSource(xslfo), pdf);

    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    Logger log = hierarchy.getLoggerFor("fop");
    if (debugMode)
    {
      log.setPriority(Priority.DEBUG);
    }
    else
    {
      log.setPriority(Priority.FATAL_ERROR);
    }
    driver.setLogger(log);
    driver.setRenderer(Driver.RENDER_PDF);
    driver.run();
    pdf.flush();
}



HTH,
Scott

-----Original Message-----
From: David B. Bitton [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 4:58 PM
To: [EMAIL PROTECTED]
Subject: Re: Multithreaded failure


Simply because it is at the top of my SOAP method.  I don't think that there
is an init() called on a SOAP class.  Also, do you instantiate a new Driver
object for every call to the servlet?  I'd appreciate if you could share
some code.  Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to