Hi all,

It have been a long time since I read any post... but I can't ignore someone in 
trouble.
I had a similar problem using java.AWT with linux...
It needs a graphics system server, like windows or X11 running in your server. 
But as X11 was too heavy for my system, my workaround was to start Xvfb (X virtual 
frame buffer). Google it  to 
get a Solaris Xvfb...
take a look also at 
http://developer.java.sun.com/developer/bugParade/bugs/4281163.html 

Regards,

miagi


On Sun, 23 Mar 2003 12:15:04 -0800, Micael <[EMAIL PROTECTED]> escreveu :

> De: Micael <[EMAIL PROTECTED]>
> Data: Sun, 23 Mar 2003 12:15:04 -0800
> Para: "Tomcat Users List" <[EMAIL PROTECTED]>
> Assunto: Re: Can't connect to X11 window server using '0:0' as the   value of the 
> display and now 
java.awt.HeadlessException
> 
> The material George gave you is really good.  Do you have X11 installed, 
> even if not running?  I am not a Solaris guy, so don't know what that may 
> mean in that context.
> 
> At 09:09 AM 3/23/03 +0000, you wrote:
> 
> >Thanks Micael. Tried the same thing and got the same results.
> >Looks like Catalina/Tomcat is indeed using headless mode but
> >it's not working with my Java (1.4) and operating system (SunOS 5.6).
> >I'm presuming you're using this to create/generate graphics in a
> >servlet ?  Do you mind posting sample Java that creates a
> >Toolkit or MediaTracker (and which therefore requires headless
> >mode) ? I can't fathom what's wrong with mine. Mine works fine
> >when running on Win2K and Tomcat, but now dying on Sun.
> >Thanks for the help,
> >Stephen.
> >
> >  Micael <[EMAIL PROTECTED]> wrote:
> >I added the headless flag to catalina.sh as follows:
> >
> ># ----- Execute The Requested Command 
> >-----------------------------------------
> >
> >echo "Using CATALINA_BASE: $CATALINA_BASE"
> >echo "Using CATALINA_HOME: $CATALINA_HOME"
> >echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
> >echo "Using JAVA_HOME: $JAVA_HOME"
> >
> >if [ "$1" = "jpda" ] ; then
> >if [ -z "$JPDA_ADDRESS" ]; then
> >JPDA_ADDRESS="8000"
> >fi
> >if [ -z "$JDPA_OPTS" ]; then
> >JPDA_OPTS="-Xdebug
> >-Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n"
> >fi
> >CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
> >shift
> >fi
> >CATALINA_OPTS="-Djava.awt.headless=true"
> >
> >This worked fine.
> >
> >
> >At 08:15 AM 3/23/03 +0000, you wrote:
> >
> > > > On Thu, 2003-03-20 at 20:36, Micael wrote:
> > > > For me the easiest thing was just to provide the right command line
> > > options
> > > > (java.awt.headless=true) when I started up Tomcat.
> > >May I ask, how you did this ? I've also encountered
> > >JNI_OnLoad errors runing on Solaris due, I suspect, the lack of
> > >XWindows on my server. I tried adding the headless flag to
> > >my catalina.sh script as follows ~
> > >elif [ "$1" = "start" ] ; then
> > > shift
> > > touch "$CATALINA_BASE"/logs/catalina.out
> > > if [ "$1" = "-security" ] ; then
> > > echo "Using Security Manager"
> > > shift
> > > "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
> > > -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
> > > -Djava.security.manager \
> > > -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
> > > -Dcatalina.base="$CATALINA_BASE" \
> > > -Dcatalina.home="$CATALINA_HOME" \
> > > -Djava.io.tmpdir="$CATALINA_TMPDIR" \
> > > -Djava.awt.headless=true \
> > > org.apache.catalina.startup.Bootstrap "$@" start \
> > > >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
> > > else
> > > "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
> > > -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
> > > -Dcatalina.base="$CATALINA_BASE" \
> > > -Dcatalina.home="$CATALINA_HOME" \
> > > -Djava.io.tmpdir="$CATALINA_TMPDIR" \
> > > -Djava.awt.headless=true \
> > > org.apache.catalina.startup.Bootstrap "$@" start \
> > > >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &
> > > fi
> > >But that just resulted in the following error,
> > >java.awt.HeadlessException
> > > at
> > > java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
> > > at java.awt.Window.(Window.java:266)
> > > at java.awt.Frame.(Frame.java:398)
> > > at java.awt.Frame.(Frame.java:363)
> > > at ImageUtils.loadImage(Unknown Source)
> > >
> > >where the loadImage() function is simply supposed to load an image,
> > > public static Image loadImage(String fileName) {
> > > Image image = Toolkit.getDefaultToolkit().getImage(fileName);
> > > MediaTracker mediaTracker = new MediaTracker(new Frame());
> > > mediaTracker.addImage(image, 0);
> > > try {
> > > mediaTracker.waitForID(0);
> > > }
> > > catch (InterruptedException ie) {
> > > //
> > > }
> > > return image;
> > > }
> > >Any ideas/help would be great.
> > >Stephen.
> > >ps. I also tried PJA but couldn't get that to work either :(
> > >
> > >
> > >
> > >
> > >---------------------------------
> > >With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits
> > >your needs
> >
> >
> >
> >LEGAL NOTICE
> >
> >This electronic mail transmission and any accompanying documents contain
> >information belonging to the sender which may be confidential and legally
> >privileged. This information is intended only for the use of the
> >individual or entity to whom this electronic mail transmission was sent as
> >indicated above. If you are not the intended recipient, any disclosure,
> >copying, distribution, or action taken in reliance on the contents of the
> >information contained in this transmission is strictly prohibited. If you
> >have received this transmission in error, please delete the message. Thank
> >you
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >---------------------------------
> >With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits 
> >your needs
> 
> 
> 
> LEGAL NOTICE
> 
> This electronic mail  transmission and any accompanying documents contain 
> information belonging to the sender which may be confidential and legally 
> privileged.  This information is intended only for the use of the 
> individual or entity to whom this electronic mail transmission was sent as 
> indicated above. If you are not the intended recipient, any disclosure, 
> copying, distribution, or action taken in reliance on the contents of the 
> information contained in this transmission is strictly prohibited.  If you 
> have received this transmission in error, please delete the message.  Thank 
> you  
> 
> 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to