Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Wentink, Marc
Dear Sirs,

I have got a servlet that generates a pdf file from a xml file, the servlet 
runs in Tomcat, and it runs fine as long as in the xml file does not contain 
references to images. At the moment the xml contains an image I got this error:

java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
at java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)


The strange thing is that if I ran the old program as an independent java 
program, I did not got the error. Hence the java environment provided by Tomcat 
misses some classes?

Thanks in advance for any suggestions.

Marc 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Paul Hamer
Hi Marc,

Are you running Tomcat on a headless machine, in other words, on a machine
that does not have any graphics drivers installed? This is the case for many
SSH-only Linux servers, like mine.

If so, then specify

-Djava.awt.headless=true 

as a parameter to Tomcat.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED] 

 -Original Message-
 From: Wentink, Marc [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 22 February, 2006 16:42
 To: tomcat-user@jakarta.apache.org
 Subject: Image files accesable for a servlet in Tomcat, but 
 they were accesible in Java standalone program
 
 Dear Sirs,
 
 I have got a servlet that generates a pdf file from a xml 
 file, the servlet runs in Tomcat, and it runs fine as long as 
 in the xml file does not contain references to images. At the 
 moment the xml contains an image I got this error:
 
 java.lang.NoClassDefFoundError
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:141)
 at 
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph
 icsEnvironment.java:62)
 at 
 java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
 at 
 java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
 at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)
 
 
 The strange thing is that if I ran the old program as an 
 independent java program, I did not got the error. Hence the 
 java environment provided by Tomcat misses some classes?
 
 Thanks in advance for any suggestions.
 
 Marc 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Wentink, Marc
Hey thanks! That's it

-Oorspronkelijk bericht-
Van: Paul Hamer [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 22 februari 2006 17:19
Aan: 'Tomcat Users List'
Onderwerp: RE: Image files accesable for a servlet in Tomcat, but they
were accesible in Java standalone program


Hi Marc,

Are you running Tomcat on a headless machine, in other words, on a machine
that does not have any graphics drivers installed? This is the case for many
SSH-only Linux servers, like mine.

If so, then specify

-Djava.awt.headless=true 

as a parameter to Tomcat.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED] 

 -Original Message-
 From: Wentink, Marc [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 22 February, 2006 16:42
 To: tomcat-user@jakarta.apache.org
 Subject: Image files accesable for a servlet in Tomcat, but 
 they were accesible in Java standalone program
 
 Dear Sirs,
 
 I have got a servlet that generates a pdf file from a xml 
 file, the servlet runs in Tomcat, and it runs fine as long as 
 in the xml file does not contain references to images. At the 
 moment the xml contains an image I got this error:
 
 java.lang.NoClassDefFoundError
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:141)
 at 
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph
 icsEnvironment.java:62)
 at 
 java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
 at 
 java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
 at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)
 
 
 The strange thing is that if I ran the old program as an 
 independent java program, I did not got the error. Hence the 
 java environment provided by Tomcat misses some classes?
 
 Thanks in advance for any suggestions.
 
 Marc 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Zohar Amir

Sorry to barge in, but maybe you can help me with my question:
If I want to reference images from my servlet, when should I put them and 
how do I reference them?

Thanks,
Zohar.

- Original Message - 
From: Wentink, Marc [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, February 22, 2006 6:20 PM
Subject: RE: Image files accesable for a servlet in Tomcat, but they were 
accesible in Java standalone program



Hey thanks! That's it

-Oorspronkelijk bericht-
Van: Paul Hamer [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 22 februari 2006 17:19
Aan: 'Tomcat Users List'
Onderwerp: RE: Image files accesable for a servlet in Tomcat, but they
were accesible in Java standalone program


Hi Marc,

Are you running Tomcat on a headless machine, in other words, on a machine
that does not have any graphics drivers installed? This is the case for many
SSH-only Linux servers, like mine.

If so, then specify

-Djava.awt.headless=true

as a parameter to Tomcat.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED]


-Original Message-
From: Wentink, Marc [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 22 February, 2006 16:42
To: tomcat-user@jakarta.apache.org
Subject: Image files accesable for a servlet in Tomcat, but
they were accesible in Java standalone program

Dear Sirs,

I have got a servlet that generates a pdf file from a xml
file, the servlet runs in Tomcat, and it runs fine as long as
in the xml file does not contain references to images. At the
moment the xml contains an image I got this error:

java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph
icsEnvironment.java:62)
at
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
at
java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)


The strange thing is that if I ran the old program as an
independent java program, I did not got the error. Hence the
java environment provided by Tomcat misses some classes?

Thanks in advance for any suggestions.

Marc


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Paul Hamer
Hi Zohar,

What doe you mean by reference ?? Please elaborate.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED] 

 -Original Message-
 From: Zohar Amir [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 22 February, 2006 17:28
 To: Tomcat Users List
 Subject: Re: Image files accesable for a servlet in Tomcat, 
 but they were accesible in Java standalone program
 
 Sorry to barge in, but maybe you can help me with my question:
 If I want to reference images from my servlet, when should I 
 put them and 
 how do I reference them?
 Thanks,
 Zohar.
 
 - Original Message - 
 From: Wentink, Marc [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, February 22, 2006 6:20 PM
 Subject: RE: Image files accesable for a servlet in Tomcat, 
 but they were 
 accesible in Java standalone program
 
 
 Hey thanks! That's it
 
 -Oorspronkelijk bericht-
 Van: Paul Hamer [mailto:[EMAIL PROTECTED]
 Verzonden: woensdag 22 februari 2006 17:19
 Aan: 'Tomcat Users List'
 Onderwerp: RE: Image files accesable for a servlet in Tomcat, but they
 were accesible in Java standalone program
 
 
 Hi Marc,
 
 Are you running Tomcat on a headless machine, in other 
 words, on a machine
 that does not have any graphics drivers installed? This is 
 the case for many
 SSH-only Linux servers, like mine.
 
 If so, then specify
 
 -Djava.awt.headless=true
 
 as a parameter to Tomcat.
 
 Regards,
 Paul Hamer
 
 management  development
 [EMAIL PROTECTED]
 
 toHAVE websolutions
 www.tohave.nl
 [EMAIL PROTECTED]
 
  -Original Message-
  From: Wentink, Marc [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, 22 February, 2006 16:42
  To: tomcat-user@jakarta.apache.org
  Subject: Image files accesable for a servlet in Tomcat, but
  they were accesible in Java standalone program
 
  Dear Sirs,
 
  I have got a servlet that generates a pdf file from a xml
  file, the servlet runs in Tomcat, and it runs fine as long as
  in the xml file does not contain references to images. At the
  moment the xml contains an image I got this error:
 
  java.lang.NoClassDefFoundError
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:141)
  at
  java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph
  icsEnvironment.java:62)
  at
  java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
  at
  java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
  at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)
 
 
  The strange thing is that if I ran the old program as an
  independent java program, I did not got the error. Hence the
  java environment provided by Tomcat misses some classes?
 
  Thanks in advance for any suggestions.
 
  Marc
 
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Zohar Amir
I mean I want to have an img 
src=http://myserver/mycontext/images/image2.gif/

Since my servlet is mapped to / it gets invoked for the above URL.

- Original Message - 
From: Paul Hamer [EMAIL PROTECTED]

To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Wednesday, February 22, 2006 6:48 PM
Subject: RE: Image files accesable for a servlet in Tomcat, but they were 
accesible in Java standalone program




Hi Zohar,

What doe you mean by reference ?? Please elaborate.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED]


-Original Message-
From: Zohar Amir [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 22 February, 2006 17:28
To: Tomcat Users List
Subject: Re: Image files accesable for a servlet in Tomcat,
but they were accesible in Java standalone program

Sorry to barge in, but maybe you can help me with my question:
If I want to reference images from my servlet, when should I
put them and
how do I reference them?
Thanks,
Zohar.

- Original Message - 
From: Wentink, Marc [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, February 22, 2006 6:20 PM
Subject: RE: Image files accesable for a servlet in Tomcat,
but they were
accesible in Java standalone program


Hey thanks! That's it

-Oorspronkelijk bericht-
Van: Paul Hamer [mailto:[EMAIL PROTECTED]
Verzonden: woensdag 22 februari 2006 17:19
Aan: 'Tomcat Users List'
Onderwerp: RE: Image files accesable for a servlet in Tomcat, but they
were accesible in Java standalone program


Hi Marc,

Are you running Tomcat on a headless machine, in other
words, on a machine
that does not have any graphics drivers installed? This is
the case for many
SSH-only Linux servers, like mine.

If so, then specify

-Djava.awt.headless=true

as a parameter to Tomcat.

Regards,
Paul Hamer

management  development
[EMAIL PROTECTED]

toHAVE websolutions
www.tohave.nl
[EMAIL PROTECTED]

 -Original Message-
 From: Wentink, Marc [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, 22 February, 2006 16:42
 To: tomcat-user@jakarta.apache.org
 Subject: Image files accesable for a servlet in Tomcat, but
 they were accesible in Java standalone program

 Dear Sirs,

 I have got a servlet that generates a pdf file from a xml
 file, the servlet runs in Tomcat, and it runs fine as long as
 in the xml file does not contain references to images. At the
 moment the xml contains an image I got this error:

 java.lang.NoClassDefFoundError
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:141)
 at
 java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph
 icsEnvironment.java:62)
 at
 java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
 at
 java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
 at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)


 The strange thing is that if I ran the old program as an
 independent java program, I did not got the error. Hence the
 java environment provided by Tomcat misses some classes?

 Thanks in advance for any suggestions.

 Marc



-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image files accesable for a servlet in Tomcat, but they were accesible in Java standalone program

2006-02-22 Thread Vinu Varghese

Add this to the CATALINA_OPTS

-Djava.awt.headless=true

in your catalina.sh

Wentink, Marc wrote:


Dear Sirs,

I have got a servlet that generates a pdf file from a xml file, the servlet 
runs in Tomcat, and it runs fine as long as in the xml file does not contain 
references to images. At the moment the xml contains an image I got this error:

java.lang.NoClassDefFoundError
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:141)
   at 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
   at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
   at java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
   at net.antonius.pdfgen.TypeImageMap.parse(Unknown Source)


The strange thing is that if I ran the old program as an independent java 
program, I did not got the error. Hence the java environment provided by Tomcat 
misses some classes?

Thanks in advance for any suggestions.

Marc 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



 



--


Vinu Varghese
[EMAIL PROTECTED]
www.x-minds.org