> 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