Are you looking for the Java code necessary to call into a .so, or are you wondering how to configure jbossas to locate the .so when your code invokes it?
yes my java code is calling a .so library .I want to know how to configure that path in jboss.
By default, the JVM sets the java.library.path system property, which is uses to locate shared objects, to the LD_LIBRARY_PATH. So as long as the LD_LIBRARY_PATH references the directory containing the .so file, you should be set.
If you install JBoss Native, check the run.sh script because at one time it set java.library.path to $JBOSS_HOME/bin/native. If that is still the case, you need to set java.library.path to $LD_LIBRARY_PATH:$JBOSS_HOME/bin/native.
I have set my LD_LIBRARY_PATH .do you mean I shud create a folder named native in jboss_home/bin.And put my .so file over there???
do you mean I shud create a folder named native in jboss_home/bin.And put my .so file over there???
No, that is not what I meant. I was merely giving you a warning on what could go wrong if you installed JBoss Native. If you have not installed JBoss Native, you can ignore that warning.
You can put your .so anywhere you like.
I dnt 9 which version of jboss is this?? how to check whteher it is native or nor?
JBoss Application Server (which you have) and JBoss Native are two different things and are two different downloads. If you did not download and install JBoss Native from http://www.jboss.org/jbossweb/downloads/jboss-native/?action=a&windowstate=maximized, then you do not have it.
I am not having jboss-native. I have set my LD_LIBRARY_PATH.Still its not working.Please tell me what shud i do.
its giving the following exception
Unexpected Error in method: public abstract java.util.ArrayList tr.TrRemote.loadText(java.lang.StringBuffer,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.rmi.RemoteException
at tr.Wrapper.execute(Native Method)
where tr bean is stateful ejb
tr remote is remote interface
Wrapper is class in which that library is called
I think library loaded exception is in calling the method
Try running ldd against your .so to see if all of the libraries it needs are also in the library path. If any of them is missing your .so will not load.
Are you sure your .so if built correctly and is exporting the correct entry points? Can you load the .so from a simple Java application?
As a standalone its running fine.I am just setting the path of .So file But this .So file is in turn using some perl scripts and one ini file.I have to use somebody else code.What shud i do.Please tell me.Thanx in advance
Try adding the -verbose:jni to the JVM command line.
Do this for both the simple Java application that works, and for jbossas. Compare the output, that might give you some idea as to what the problem is.
Also, what did the ldd utility tell you?