• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

registration image error

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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:

javax.imageio.IIOException: Can't create output stream!

Any ideas what I may be missing? I did installed required X packages, and convigured JVM for headless server.

Regards,
adam
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:


[originally posted on jforum.net by azimowski]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

cd <tomcathome>
ln -s /tmp/tomcat tmp

took care of the problem! Now it's all working :-)
[originally posted on jforum.net by azimowski]
 
reply
    Bookmark Topic Watch Topic
  • New Topic