I moved the creation (and destruction) of the Driver object inside the method. Also I had forgotten that in Apache SOAP, you can control object lifetime. So I changed it from Application to Request, so now each request gets a fresh instance of my class.
This works, but I'm not happy with it. My question is this, if I have a Driver object as a global inside my class, will it be trounced by another instance running in a different thread? -- David B. Bitton [EMAIL PROTECTED] www.codenoevil.com Code Made Fresh DailyT ----- Original Message ----- From: "Scott Moore" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 04, 2002 5:23 PM Subject: RE: Multithreaded failure > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]