HTTP 500 Internal Server Error on Captcha Field.

Posted by Rollbase User on 25-Sep-2012 14:27

The attached screenshot shows that the Captcha Image has not loaded as well as the console error in Chrome. This is an Object Create Portal Page. Any idea why this might be happening?

All Replies

Posted by Admin on 25-Sep-2012 15:43

Please make sure that simple captcha JAR file is placed into Tomcat/lib directory. Please also provide full error message.

Posted by Admin on 25-Sep-2012 15:58

I have asked our Director of Technology to check the directory. In the meantime, here is a more detailed description of the error from the browser.

Posted by Admin on 25-Sep-2012 16:00

I have asked our Director of Technology to check the directory you specified. In the meantime, here is a screen shot of a more detailed error message from the browser

Posted by Admin on 25-Sep-2012 16:00

Pavel, you mean lsimplecaptcha.jar? Yes, it's in our lib directory. What else can we try?

Posted by Admin on 25-Sep-2012 16:04

Try adding Java option



-Djava.awt.headless=true



http://www.giannistsakiris.com/index.php/2007/09/26/simple-captcha-javaawtheadlessexception/

Posted by Admin on 26-Sep-2012 07:41

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?

Posted by Admin on 26-Sep-2012 09:57

"Simple Captcha" is 3rd-party software and we do not have control over it. Sorry for inconvenience.

Posted by Admin on 26-Sep-2012 10:11

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.

Posted by Admin on 26-Sep-2012 11:16

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?

Posted by Admin on 26-Sep-2012 11:48

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"

Posted by Admin on 26-Sep-2012 11:50

Joseph,



you can find additional info here:



http://sourceforge.net/tracker/?func=detail&aid=1373838&group_id=147810&atid=769555

Posted by Admin on 27-Sep-2012 12:01

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

Posted by Admin on 27-Sep-2012 21:38

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

This thread is closed