Normally graphics operations are done by a graphic frontend but some
systems do not have such a thing available - this is the case for Java
programs on iSeries without access to an X11 server (which is what NAWT
helps providing). By providing the "java.awt.headless=true" property to
the java command, it tells it to use an internal implementation which do
not require such access.
I finally managed to get my Captcha work on my System i.
It took some time to compile all information I got through the web and
with this list,
and to figure out how it could be adapted on my system.
The application is compiled with JDK 1.4, and runs with Websphere 6.0 on
OS V5R4M0, and PASE installed.
I had to go through the following steps :
1) download from IBM website and install the iSeries Tools for
Developers (5799PTL).
2) modify Websphere configuration, adding a custom property
java.awt.headless = true to the JVM config
3) stop and restart Websphere
4) split the simpleCaptcha jar in two, so that I could modify the
sources of the nl package (they can be downloaded from the Source Forge
SimpleCaptcha project page), and let the com package be (the sources of
the classes in the com package are not available, and Jad fails to
decompile them).
5) in nl.captcha.text.imp.DefaultWordRenderer class, I had to comment
the lines trying to address GraphicsEnvironment and GraphicsDevice classes
(see a very helpful doc here :
http://www.giannistsakiris.com/index.php/2007/09/26/simple-captcha-javaawtheadlessexception/)
6) compile and deploy my webapp with the modification
7) sigh with relief
8) send a big thanks to people who put me on the right track with
their replies :-)
Marie-Line
As an Amazon Associate we earn from qualifying purchases.