users@glassfish.java.net

Web Application calling JNI problem in clustered environment

From: <glassfish_at_javadesktop.org>
Date: Fri, 12 Sep 2008 12:34:03 PDT

I have a web application that provides images to a user based on the params of the request. The image processing is legacy native (C++) code. Here's a description of the use case.

1. User requests set of images based on various params via browser and submits to Servlet.
2. Servlet retrieves params and calls Facade/Proxy object.
3. Facade object invokes a JNI method passing params (Strings and integers).
4. JNI code calls legacy image processing routines that create jpgs and pngs. Those files are written to a directory that is Web Server accessible.
5. Returns flow back through w/ status back to browser where, using JSP, build the urls to the images that were just created.

Here's the problem... I can run this web app in standalone mode on Glassfish, Tomcat v5.5 and WebSphere 6 with no issues. When we go to deploy the app on a clustered Glassfish we receive errors within the native code that indicate that we can't open the input graphic files that we use to create the custom user images. But here's a kicker... sometimes it works. No rhyme or reason.

These input files are outside of the Glassfish directory structure. We've added the appropriate security policies for both input and output directories and run Glassfish both w/ and w/o security manager. The OS level file settings are ok as the user running glassfish is the same user as the owner of the files and we've opened the files up to everyone as a test. I have an MDB that is deployed to the same cluster that can write to those directories.

I just don't know if the problem is a java vm issue or a file system. Here is a brief description of my environment:

Solaris 10
Sun Java System Application Server 9.1_02 (build b04-fcs)
JDK 1.5.0_14-b03

I'm at my wits end as I can't figure it out due to the fact that sometimes it works, sometimes it doesn't and that it works in standalone.

Any suggestions on what to look at would greatly be appreciated.

Thanks,
[Message sent by forum member 'aeronautical96' (aeronautical96)]

http://forums.java.net/jive/thread.jspa?messageID=299118