I've setup JForum on a headless Slackware server, and all seems to be working except that at the registration screen spam-prevention image is not getting generated. The following error is shown in the log instead:
I am responding to myself because I have more details upon further research, but still no exact answer.. First of all, I'm on version 2.1.4, and the problem again is the Captcha image that is supposed to be displayed during the registration process. The image is not displaying and as a result nobody can register. I do want that feature though.
I modified net.jforum.util.Captcha.java method writeCaptchaImage() catch block to spit out detailed trace as that's where error is happening, and turns out (I'm pretty sure) that it's trying to create a temp file somewhere on my filesystem where it either doesn't have permissions, or the directory it's trying to write to does not exist, however, the detailed trace does not tell me where it's trying to write to:
Hey - it's me again. I was close last time and now I have the answer, so I figured I post it to save time for others. Turned out this was more-less tomcat related, and depending on how tomcat is setup could affect anybody.
Captcha is written thru Sun's javax.imageio.ImageIO which in turn uses a file system to persist temp info. That means it needs to write the temporary image somewhere before it displays it. I just didn't know where.. Tomcat internally must be somehow setting temp directory by calling setCacheDirectory, so ImageIO in turns is trying to write it to <tomcathome>/tmp (on Linux which is what I use). My tomcat temp directory exists, but in /tmp/tomcat, so doing a symbolic link like this:
ln -s /tmp/tomcat tmp
took care of the problem! Now it's all working :-) [originally posted on jforum.net by azimowski]
He's giving us the slip! Quick! Grab this tiny ad!