You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Ramakrishnan.G" <ra...@sakinfotech.co.in> on 2002/03/04 15:26:11 UTC

Batik problem in multithreaded application

Hai,

I am using batik and fop for Pdf generation.
Everything runs fine for single thread.
When i start multithread the following error occurs.

ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
the document preceding the root element must be well-formed.
ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
the document preceding the root element must be well-formed.
ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)


Can anyone please tell me how to solve this.

Thanks and Regards

Ramakrishnan.G


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


Re: Batik problem in multithreaded application

Posted by Keiron Liddle <ke...@aftexsw.com>.
Hi,

This is really for the fop list but it appears that your problem is a 
threading issue with the way that FOP handles images.


On 2002.03.05 05:28 Ramakrishnan.G wrote:
> Hai Vincent,
> 
> Basically my aim is to generate pdf and ps from xml and xsl files.
> As i have to process bulk of files with 100 kb (XML) each, i decided to
> go for threads.
> 
> My application works like this.
> 
>  I am using Driver class from fop to start Fop. I am not directly calling
> batik.
> Fop uses Batik.When i start multiple threads which in turn create
> multiple
> Driver instances
> the error occurs. This error occurs only when fop processes the first
> image.
> 
>       mDriver = new Driver();
>       Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
>       hierarchy.setDefaultPriority(Priority.INFO);
>       mFOPLog = hierarchy.getLoggerFor("Fop");
>       mDriver.setLogger(mFOPLog);
>       mDriver.setRenderer(Driver.RENDER_PDF);
>       mDriver.setOutputStream(pdfFile);
>       mParser=mInputHandler.getParser();
>       mDriver.render(mParser,  mInputHandler.getInputSource());
>       pdfFile.flush();
>       pdfFile.close();
> 
> this is what is happening in each thread.
> 
> And this is error is not affecting the Output.
> 
> Can u please suggest me some performance improvement options for FOP.
> 
> Thanks and Regards
> Ramakrishnan.
> 
> -----Original Message-----
> From: Vincent Hardy [mailto:vincent.hardy@sun.com]
> Sent: Monday, March 04, 2002 9:25 PM
> To: Batik Users
> Subject: Re: Batik problem in multithreaded application
> 
> 
> Ramakrishnan,
> 
> Could you give some more details about how you are trying to
> multi-thread your application? Which objects are you using from
> different threads?
> 
> Vincent.
> 
> "Ramakrishnan.G" wrote:
> >
> > Hai,
> >
> > I am using batik and fop for Pdf generation.
> > Everything runs fine for single thread.
> > When i start multithread the following error occurs.
> >
> > ERROR   10152   [fop     ] (): Could not load external SVG: Stream
> closed
> > ERROR   10152   [fop     ] (): Could not load external SVG: The markup
> in
> > the document preceding the root element must be well-formed.
> > ERROR   10152   [fop     ] (): Could not load external SVG: Stream
> closed
> > ERROR   10152   [fop     ] (): Could not load external SVG: The markup
> in
> > the document preceding the root element must be well-formed.
> > ERROR   10152   [fop     ] (): Could not load external SVG: Stream
> closed
> > ERROR   10152   [fop     ] (): Could not load external SVG: Stream
> closed
> > ERROR   10152   [Fop     ] (): Error while creating area : No
> ImageReader
> > for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
> > ERROR   10152   [Fop     ] (): Error while creating area : No
> ImageReader
> > for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
> >
> > Can anyone please tell me how to solve this.
> >
> > Thanks and Regards
> >
> > Ramakrishnan.G
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 

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


RE: Batik problem in multithreaded application

Posted by "Ramakrishnan.G" <ra...@sakinfotech.co.in>.
Hai Vincent,

Basically my aim is to generate pdf and ps from xml and xsl files.
As i have to process bulk of files with 100 kb (XML) each, i decided to
go for threads.

My application works like this.

 I am using Driver class from fop to start Fop. I am not directly calling
batik.
Fop uses Batik.When i start multiple threads which in turn create multiple
Driver instances
the error occurs. This error occurs only when fop processes the first image.

      mDriver = new Driver();
      Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
      hierarchy.setDefaultPriority(Priority.INFO);
      mFOPLog = hierarchy.getLoggerFor("Fop");
      mDriver.setLogger(mFOPLog);
      mDriver.setRenderer(Driver.RENDER_PDF);
      mDriver.setOutputStream(pdfFile);
      mParser=mInputHandler.getParser();
      mDriver.render(mParser,  mInputHandler.getInputSource());
      pdfFile.flush();
      pdfFile.close();

this is what is happening in each thread.

And this is error is not affecting the Output.

Can u please suggest me some performance improvement options for FOP.

Thanks and Regards
Ramakrishnan.

-----Original Message-----
From: Vincent Hardy [mailto:vincent.hardy@sun.com]
Sent: Monday, March 04, 2002 9:25 PM
To: Batik Users
Subject: Re: Batik problem in multithreaded application


Ramakrishnan,

Could you give some more details about how you are trying to
multi-thread your application? Which objects are you using from
different threads?

Vincent.

"Ramakrishnan.G" wrote:
>
> Hai,
>
> I am using batik and fop for Pdf generation.
> Everything runs fine for single thread.
> When i start multithread the following error occurs.
>
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
> the document preceding the root element must be well-formed.
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
> the document preceding the root element must be well-formed.
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
> for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
> ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
> for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
>
> Can anyone please tell me how to solve this.
>
> Thanks and Regards
>
> Ramakrishnan.G
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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


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


Re: Batik problem in multithreaded application

Posted by Vincent Hardy <vi...@sun.com>.
Ramakrishnan,

Could you give some more details about how you are trying to 
multi-thread your application? Which objects are you using from
different threads?

Vincent.

"Ramakrishnan.G" wrote:
> 
> Hai,
> 
> I am using batik and fop for Pdf generation.
> Everything runs fine for single thread.
> When i start multithread the following error occurs.
> 
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
> the document preceding the root element must be well-formed.
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: The markup in
> the document preceding the root element must be well-formed.
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [fop     ] (): Could not load external SVG: Stream closed
> ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
> for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
> ERROR   10152   [Fop     ] (): Error while creating area : No ImageReader
> for this type of image (file:d:/truecredit/TRL-RGS/images/logo.gif)
> 
> Can anyone please tell me how to solve this.
> 
> Thanks and Regards
> 
> Ramakrishnan.G
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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