users@glassfish.java.net

Re: Calling the linux shell from Glassfish

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Oct 2007 10:14:29 PDT

Many thanks for the correction, and in the process I discovered that there are no spaces on either side of the "=" sign.

After issuing the "asadmin set ...." command linking in my shared library and stopping then restarting the server, I saw the entry in the JVM path setting in the console, which is a good sign. I then went to the appropriate URL in local host to execute the Bean that calls up the native code, but got the following error message in the log:

java.lang.UnsatisfiedLinkError: com.corejsf.UserBean.system(Ljava/lang/String;)V), detail=(java.lang.UnsatisfiedLinkError: com.corejsf.UserBean.system(Ljava/lang/String;)V)];

I deleted the ".war" file in the autodeploy directly, recompiled the Java class, created a new ".war" file and copied it over again into the autodeply directory, and this time got the message:

PWC1406: Servlet.service() for servlet Faces Servlet threw exception java.lang.UnsatisfiedLinkError: Native Library /usr/local/glassfish/lib/libCallSystem.so already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:

So it looks as if somehow it is trying to find the library, but there is still a problem.

The string I am sending to the shell is "ls -lt > jnioutput.txt" which creates the file "jnioutput.txt" in the current directory, wherever that is, and writes the list of files in that directory to the file. Not surprisingly, a search for "jnioutput.txt" bring up nothing.

It looks as if maybe I could be on the right track, and would most appreciate some help in getting this sorted out.

csharpdotcom
[Message sent by forum member 'csharpdotcom' (csharpdotcom)]

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