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 Chandra <ch...@hotmail.com> on 2004/10/11 11:06:41 UTC

JPG generation problem in Linux

Hi,

I tried to generate JPG from SVG. 

In Windows environment it is working well.  

I'm getting problem while generating JPG file in specific cases on RedHat Linux ES 3.0 environment.

The following are the lines of code used by me to create jpg.

istream = new StringReader(contentSVG);
trans = new JPEGTranscoder();
input = new TranscoderInput(istream);
ostream = new FileOutputStream("filename.jpg");
output = new TranscoderOutput(ostream);
trans.transcode(input, output);

In Case1 when I directly execute this program it is working perfectly.  Even though the user who is executing this is not a root user.

In Case2 When this program is called by another service.  
                
    The service was started by non-root user.  In this case it creating the file called "filename.jpg" and after that trans.transcode() method is not updating the file so the size of the file same as 0 bytes.
               
    The service was started by root user.  Everything working fine.  The file creating and file updated with the bytes so the actual jpg image exist in the file.  

If you anyone have any idea on this problem could you please guide me.

Regards,
Chandra

Re: JPG generation problem in Linux

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,


> Exception org.apache.batik.transcoder.TranscoderException: null
> Enclosed Exception:
> SAX2 driver class org.apache.xerces.parsers.SAXParser not found.
> 
> kept all the necessary jar files in Classpath

Very weird indeed because you include all the jar files. Just make sure
that xerces_2_5_0.jar are in the classpath. Also check out your
classpath that no other xerces**.jar is loaded other than the required
xerces_2_5_0.jar.

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com



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


Re: JPG generation problem in Linux

Posted by Chandra <ch...@hotmail.com>.
Hi Thomas.

Thanks for your reply.

I'm facing the problem in RedHat Linux Enterprise Server3.0. The same code
working well in RedHat Linux 7.2

The same piece of code executing well from the Console.
I got the following exception when I tried to execute from another service.

Exception org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
SAX2 driver class org.apache.xerces.parsers.SAXParser not found.

kept all the necessary jar files in Classpath

If you have any idea plz let me know.

Thanks in Advance,

Chandra



----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Monday, October 11, 2004 3:55 PM
Subject: Re: JPG generation problem in Linux


> Hi Chandra,
>
>      My first guess would be that Java can't find the
> X display (are you logging the output of Java/Batik anywhere
> in the 'service' case?).  The simplest solution to this,
> if you are using Java 1.4, is to use headless mode.  Search
> the net for 'java headless' and you should get all
> the info you need (including other workarounds
> if this isn't feasible).
>
> Chandra wrote:
>
> >
> > Hi,
> >
> > I tried to generate JPG from SVG.
> >
> > In Windows environment it is working well.
> >
> > I'm getting problem while generating JPG file in specific cases on
> > RedHat Linux ES 3.0 environment.
> >
> > The following are the lines of code used by me to create jpg.
> >
> > istream = new StringReader(contentSVG);
> > trans = new JPEGTranscoder();
> > input = new TranscoderInput(istream);
> > ostream = new FileOutputStream("filename.jpg");
> > output = new TranscoderOutput(ostream);
> > trans.transcode(input, output);
> >
> > In Case1 when I directly execute this program it is working perfectly.
> > Even though the user who is executing this is not a root user.
> >
> > In Case2 When this program is called by another service.
> >
> >     The service was started by non-root user.  In this case it creating
> > the file called "filename.jpg" and after that trans.transcode() method
> > is not updating the file so the size of the file same as 0 bytes.
> >
> >     The service was started by root user.  Everything working fine.  The
> > file creating and file updated with the bytes so the actual jpg image
> > exist in the file.
> >
> > If you anyone have any idea on this problem could you please guide me.
> >
> > Regards,
> > Chandra
>
>
> ---------------------------------------------------------------------
> 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: JPG generation problem in Linux

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Chandra,

     My first guess would be that Java can't find the
X display (are you logging the output of Java/Batik anywhere
in the 'service' case?).  The simplest solution to this,
if you are using Java 1.4, is to use headless mode.  Search
the net for 'java headless' and you should get all
the info you need (including other workarounds
if this isn't feasible).

Chandra wrote:

> 
> Hi,
>  
> I tried to generate JPG from SVG.
>  
> In Windows environment it is working well. 
>  
> I'm getting problem while generating JPG file in specific cases on 
> RedHat Linux ES 3.0 environment.
>  
> The following are the lines of code used by me to create jpg.
>  
> istream = new StringReader(contentSVG);
> trans = new JPEGTranscoder();
> input = new TranscoderInput(istream);
> ostream = new FileOutputStream("filename.jpg");
> output = new TranscoderOutput(ostream);
> trans.transcode(input, output);
>  
> In Case1 when I directly execute this program it is working perfectly.  
> Even though the user who is executing this is not a root user.
>  
> In Case2 When this program is called by another service. 
>                
>     The service was started by non-root user.  In this case it creating 
> the file called "filename.jpg" and after that trans.transcode() method 
> is not updating the file so the size of the file same as 0 bytes.
>               
>     The service was started by root user.  Everything working fine.  The 
> file creating and file updated with the bytes so the actual jpg image 
> exist in the file. 
>  
> If you anyone have any idea on this problem could you please guide me.
>  
> Regards,
> Chandra


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