users@glassfish.java.net

Generating PDF with flyingsaucer / itext in a servlet under glassfish

From: <glassfish_at_javadesktop.org>
Date: Thu, 19 Jul 2007 07:18:05 PDT

Hi everybody,

I need to generate pdfs with flyingsaucer and itext inside a servlet deployed on glassfish. I have the following minimal code:


public class PDFGeneratorServlet extends HttpServlet {

  protected void execute(HttpServletRequest request,
      HttpServletResponse response) throws ServletException, IOException {

    try {
      System.out.println("start pdf generator");

      ITextRenderer renderer = new ITextRenderer();
      // more pdf generation code comes here (nonrelevant)

      System.out.println("end pdf generator");
    }
    catch (Exception e) {
      System.out.println("error pdf generator");
    }
  }



when the servlet is accessed, "start pdf generator" comes in the log, afterwards the logging of glassfish crashes. the second output "end pdf generator" does not come in the log. the servlet still lives - pdfs can be generated - everything works fine, but the logging..

I tried with log4j, java logger and 'normal' System.out.println...

It seams, that the simple instantiation of an 'ITextRenderer' let the Glassfish logging crash. (see code above).

I also tried with tomcat 5 - it worked perfectly.

Has anybody an idea how to fix this ? A bug in glassfish ? I could send the whole code, war-file etc. upon request.

many thanks

Boris
[Message sent by forum member 'boris_z' (boris_z)]

http://forums.java.net/jive/thread.jspa?messageID=227293