Please make sure that simple captcha JAR file is placed into Tomcat/lib directory. Please also provide full error message.
Pavel, you mean lsimplecaptcha.jar? Yes, it's in our lib directory. What else can we try?
Try adding Java option
-Djava.awt.headless=true
http://www.giannistsakiris.com/index.php/2007/09/26/simple-captcha-javaawtheadlessexception/
It looks like we already have headless set to true we have the following in /etc/init.d/tomcat6:
# Default Java options
# Set java.awt.headless=true if JAVA_OPTS is not set so the
# Xalan XSL transformer can work without X11 display on JDK 1.4+
# It also looks like the default heap size of 64M is not enough for most cases
# so the maximum heap size is set to 128M
if [ -z "$JAVA_OPTS" ]; then
JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
fi
What else can we try?
"Simple Captcha" is 3rd-party software and we do not have control over it. Sorry for inconvenience.
Whether 3rd-party or not, you chose to use it in *your* software. What are we to do? We don't have the access needed to replace it with something that does work. However, you do have access and I think you need to get this working.
First it would be nice to know who you are and what's your company name. Can you please use your real name instead of alias?
Hi Pavel, this is Joseph from Good Done Great. Sorry, I thought you knew. Byt the way, in the meantime I looked into /etc/default/tomcat6 and found the following:
# You may pass JVM startup parameters to Java here. If unset, the default
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
#
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
# response time). If you use that option and you run Tomcat on a machine with
# exactly one CPU chip that contains one or two cores, you should also add
# the "-XX:+CMSIncrementalMode" option.
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
Joseph,
you can find additional info here:
http://sourceforge.net/tracker/?func=detail&aid=1373838&group_id=147810&atid=769555
Hi Joseph,
Did you manage to get past the "java.awt.HeadlessException" yet? Based on the exception it looks like the headless option is not being respected for some reason. FYI this is the first time we have encountered this and I am surprised it is happening to you only given that this component is being used widely. I'd like to find out why this is happening -- let me know if you've found anything other than the exception.
Thanks,
Matt
Hi Joseph,
I did some searching on this issue and it appears SimpleCaptcha has had this issue in the past specifically on UNIX machines. At the time this was found it modifications to the code as specified here:
http://www.giannistsakiris.com/index.php/2007/09/26/simple-captcha-javaawtheadlessexception/
However, this was from 2007. Apparently a fix has been made in more recent version:
http://techblog.ralph-schuster.eu/2007/11/21/simplecaptcha-for-servers/
We are hesitant to distribute modified binaries of third party code with the product, but you may have some luck with the above approach or using a different version of SimpleCaptcha in your environment. More specifically you may want to download one of the versions here to see if it solves your problem:
http://simplecaptcha.sourceforge.net/
...or at the more extreme end do a build from the SimpleCaptcha source code (which is available at that same URL) with the above fixes if they are still necessary.
I hope this is somewhat helpful,
Matt