Create images in headless environment
2 posts in topic
Flat View  Flat View

Posted By:   Bozhidar_Bozhanov
Posted On:   Sunday, December 24, 2006 02:54 PM


I'm trying to create a captcha (and some other images, too) on a Linux server with no X-liraries.
I added the -Djava.awt.headless=true, but that doesn't seem to work.

I did not fully understand whether it is possible to generate images without the X, so I'm asking - whether, and how.
(java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk- cannot open shared object file: No such file or directory)


Re: Create images in headless environment

Posted By:   Anonymous  
Posted On:   Wednesday, January 10, 2007 09:09 PM

Hi. I had a captcha that was working and then a server upgrade broke my servlet. Over the last couple of days I've been looking into my problem. Here is a link that may help you with your problem. As for myself, I took another approach. Rather than fight with the server, I decided to have a captcha that would be independent of awt. At the same time I wanted a java solution. What I came up with seems to work very well and I wrote a newsletter to document what I did so that others might benefit. Hope that helps


Dan Andrews

Re: Create images in headless environment

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, January 7, 2007 12:28 PM

We worked on it for a long time, a year ago or so, and found that it depends on the application server. (oh but first yes you do need the X libraries, of course, on unix/linux/mac etc., or else the Microsoft Windows libraries on MS Windows; it's got to use some native graphics library, and those are your 2 choices)

You need that headless stuff (which wasn't there in 1.3 JVM's), and you also need some additional libraries, "pja.jar" I think (?) to be on the initial "boot classpath" of the jvm, not just on the regular CLASSPATH.

We got it working most easily in Tomcat; in Websphere we got it working via some configuration changes (maybe in the admin console? I forget). But for WebLogic we had to change some startup parameters, on the jvm, in the startup scripts (and this differs depending on whether you have a cluster with a node manager, or not). and just imagine the fun, working with a remote set of sysadmins, to change the startup scripts for their clustered servers, just for your one application...... and if you do it wrong, you crash the whole cluster....
About | Sitemap | Contact