You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Gian Piero Bottini <gi...@one.it> on 2003/02/03 09:26:57 UTC

fop + servlet + multisession

Hi all 
I'm  sorry for my english very poor...
anyway..
I am using FOP 0.20.5rc to produce PDF files from XML and XSL-FO
I use a servlet in Tomcat 4.04
if I  have a large file (100 pages) and 2 session of IE are working concurrently 
there are no exception but  the two processes don't finish and the pdf files are not displayed..


Thanks for help
regards

Gian Piero
P.S .
I launch java with the option  -Xmx500MB -Xms500MB and if I have small files there are no problem with multiple session of IE 


Re: fop + servlet + multisession

Posted by Gian Piero Bottini <gi...@one.it>.
Thanks  a lot 
but sometimes (with 3 session of IE)
tomcat  stops without exception or without particolar debug messages...
Somebody have any ideas??
Could be a memory problem??

Regards
  Gian Piero



----- Original Message ----- 
From: "Fabrizio Tringali" <f....@infser.it>
To: <fo...@xml.apache.org>
Sent: Monday, February 03, 2003 12:39 PM
Subject: Re: fop + servlet + multisession


> ciao Gian Piero,
> 
> this is the snippet to set the log level to debug            
> --------------------------
> //Setup logger
> Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);
> driver.setLogger(logger);
> MessageHandler.setScreenLogger(logger);
> --------------------------
> 
> 
> "and sometimes the servlet is called twice( why??)"
> it's a bug of  IE 5.0/5.5
> 
> 
> 
> hope this help
> 
> fabrizio
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: fop + servlet + multisession

Posted by Fabrizio Tringali <f....@infser.it>.
ciao Gian Piero,

this is the snippet to set the log level to debug            
--------------------------
//Setup logger
Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG);
driver.setLogger(logger);
MessageHandler.setScreenLogger(logger);
--------------------------


"and sometimes the servlet is called twice( why??)"
it's a bug of  IE 5.0/5.5



hope this help

fabrizio

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: fop + servlet + multisession

Posted by Gian Piero Bottini <gi...@one.it>.
Now I'll try to encrease the debug level...(by the way how can I do that??)
Now my output in the dos-Tomcat window is this ( I'm creating a pdf document
99 pages long):

[INFO] [99]
[INFO] [86]
[INFO] [87]
[INFO] [88]
[INFO] Parsing of document complete, stopping renderer
[INFO] [89]

and it seems blocked but I don't know.....
but sometimes it works fine...very strange...
and sometimes the servlet is called twice( why??)

This is the code:

.........
try{
           XSLTInputHandler input =
                    new XSLTInputHandler(xmlFile,
                                       xslFile);
            renderXML(input, response);

      } catch (Exception ex) {
                 ex.printStackTrace();
      }
.....................

public void renderXML(XSLTInputHandler input,
                          HttpServletResponse response) throws
ServletException {
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            response.reset();

            // questa riga รจ necessaria per IE che forse non capisce il
SetContentType()
            response.setHeader("Content-Disposition","inline; filename=" +
"Report1.pdf");
            response.setContentType("application/pdf");

            org.apache.fop.apps.Driver driver = new
org.apache.fop.apps.Driver();

            driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
            System.gc();
            driver.setOutputStream(out);
            driver.render(input.getParser(), input.getInputSource());
            System.gc();
            System.out.println("stop render");
            byte[] content = out.toByteArray();
            response.setContentLength(content.length);
            response.getOutputStream().write(content);
            response.getOutputStream().flush();
        } catch (Exception ex) {
            throw new ServletException(ex);
        }
    }

Thanks a lot
Regards

Gian Piero












----- Original Message -----
From: "Oleg Tkachenko" <ol...@multiconn.com>
To: <fo...@xml.apache.org>
Sent: Monday, February 03, 2003 9:59 AM
Subject: Re: fop + servlet + multisession


> Gian Piero Bottini wrote:
>
> > I am using FOP 0.20.5rc to produce PDF files from XML and XSL-FO
> > I use a servlet in Tomcat 4.04
> > if I  have a large file (100 pages) and 2 session of IE are working
> > concurrently
> > there are no exception but  the two processes don't finish and the pdf
> > files are not displayed..
> Did FOP finish processing? Run FOP in debug mode and analize debug
messages.
> --
> Oleg Tkachenko
> Multiconn Technologies, Israel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: fop + servlet + multisession

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Gian Piero Bottini wrote:

> I am using FOP 0.20.5rc to produce PDF files from XML and XSL-FO
> I use a servlet in Tomcat 4.04
> if I  have a large file (100 pages) and 2 session of IE are working 
> concurrently 
> there are no exception but  the two processes don't finish and the pdf 
> files are not displayed..
Did FOP finish processing? Run FOP in debug mode and analize debug messages.
-- 
Oleg Tkachenko
Multiconn Technologies, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org