users@glassfish.java.net

Re: Calling the linux shell from Glassfish

From: <glassfish_at_javadesktop.org>
Date: Tue, 16 Oct 2007 12:34:02 PDT

What you are doing is crazy!

Just kiddin!. We knew you will try out all sorts of things when you want to get "it done". So, no
worries. GlassFish has solutions to your problems :)

Here is what you need to do:

- Save your .so at a convenient location. I'd recommend placing it in gf-install-dir/lib as libcallsystem.so (for example).
- Log on to Admin Console or use asadmin as:
  - on Console, you should find the JVM configuration page and look for native-library-suffix which
    gives the server a way to add its value to server's java.library.path.
  - on asadmin, do: asadmin set
   server.java-config.native-library-suffix=gf-install-dir/lib/libcallsystem.so.
- Call the methods from here using System.LoadLibrary("callsystem") from within your bean.
- Restart the server.

The way it works is, whatever is available at above attributes in domain.xml is passed to the -Djava.library.path as an argument.

Let me know if it works.

- Kedar
[Message sent by forum member 'km' (km)]

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