Integrating FOP in a Project
Hi evrybody ! excuse me for my english but i'm french so i will try to be clear but ... so i have a problem with using fop. I work on an application in Java 1.4 and when i use fop to create a file on the file system in a java program it works BUT i can't do the same thing with my server. I would generate an PDF in a servlet with this code : public static void doPDF(Document xml, Document xsl, Document xslfo, OutputStream outputstream) throws Exception { DOMSource transformXSLT = new DOMSource(xsl); DOMResult resultatXSLFO = new DOMResult(xslfo); DOMSource sourceXML = new DOMSource(xml); logger.warn(XML TO FO TRANSFORMATION BEGIN); gcpmrds.xsl.xslTransform.transformUri( sourceXML, transformXSLT, null, resultatXSLFO ); logger.warn(XML TO FO TRANSFORMATION END); logger.warn(FO TO PDF TRANSFORMATION BEGIN); File pdffile = new File(C:/Resultat.pdf); OutputStream out = new java.io.FileOutputStream(pdffile); out = new java.io.BufferedOutputStream(out); logger.warn(A); //Driver driver = new Driver((InputSource)xslfo,out); Driver driver = new Driver(); logger.warn(A); driver.setRenderer(Driver.RENDER_PDF); driver.setInputSource((InputSource)xslfo); driver.setOutputStream(out); driver.run(); out.close(); logger.warn(FO TO PDF TRANSFORMATION END); } And my problem is that i haven't any exception or error but the program never go out of the Driver driver = new Driver() and if i use Driver driver = new Driver((InputSource)xslfo,out) it's the same problem so i don't know what's the matter. Perhaps i've got forget a jar ? thanks for help ! ** The sender's email address has changed to firstname.lastname@ sgcib.com. You may want to update your personal address book. Please see http://www.sgcib.com for more information. ** This message and any attachments (the message) are confidential and intended solely for the addressee(s). Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. *** L'adresse mail de votre correspondant a change en prenom.nom@ sgcib.com. Il est recommande de mettre a jour votre carnet d'addresse personnel.Pour plus d'informations, aller sur http://www.sgcib.com ** Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, modifie ou falsifie. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Integrating FOP in a Project
i use fop 0.20.5 and i can't use driver.initialize() because it doesn't exist. but i don't think that's the problem because in my program the logger never print the second A so I suppose the application stop in the Driver driver = new Driver() line !!! thanks for your help ! [EMAIL PROTECTED] To: [EMAIL PROTECTED] 07/08/04 05:23 PMcc: Please respond toSubject: Re: Integrating FOP in a Project fop-user I think you're missing one line of code: --- [EMAIL PROTECTED] wrote: logger.warn(A); //Driver driver = new Driver((InputSource)xslfo,out); Driver driver = new Driver(); driver.initialize(); logger.warn(A); driver.setRenderer(Driver.RENDER_PDF); driver.setInputSource((InputSource)xslfo); driver.setOutputStream(out); driver.run(); Glen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** The sender's email address has changed to firstname.lastname@ sgcib.com. You may want to update your personal address book. Please see http://www.sgcib.com for more information. ** This message and any attachments (the message) are confidential and intended solely for the addressee(s). Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration.Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. *** L'adresse mail de votre correspondant a change en prenom.nom@ sgcib.com.Il est recommande de mettre a jour votre carnet d'adresses personnel.Pour plus d'informations, aller sur http://www.sgcib.com ** Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration.La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, modifie ou falsifie. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Integrating FOP in a Project
I work on a local Dev server that is an Apache Tomcat 4.0 so i use the default configuration (except few minor things) In the future i won't use the file system, i will send pdf direct in the outputstream of my servlet ! [EMAIL PROTECTED] To: [EMAIL PROTECTED] 07/08/04 05:56 PMcc: Please respond toSubject: Re: Integrating FOP in a Project fop-user [EMAIL PROTECTED] wrote: File pdffile = new File(C:/Resultat.pdf); Does your server have a C: drive? :-) Furthermore, it's almost always a waste to use DOM trees for intermediate XML documents. Check out the code samples on the FOP website for more information. But neither of these appears to be your problem: And my problem is that i haven't any exception or error but the program never go out of the Driver driver = new Driver() This method doesn't do much except setting up the element mapping tables. In particular it doesn't do anything to the output stream. It tries to get a class loader for accessing the mapping property files though, which might be a problem. Whats your environment on the server? Are there any user written class loaders or such? Security policies? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** The sender's email address has changed to firstname.lastname@ sgcib.com. You may want to update your personal address book. Please see http://www.sgcib.com for more information. ** This message and any attachments (the message) are confidential and intended solely for the addressee(s). Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. *** L'adresse mail de votre correspondant a change en prenom.nom@ sgcib.com. Il est recommande de mettre a jour votre carnet d'addresse personnel.Pour plus d'informations, aller sur http://www.sgcib.com ** Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration. La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, modifie ou falsifie. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]