-
1. Re: how to call native library
peterj Apr 17, 2008 11:51 AM (in response to xps2nini2000)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?
-
2. Re: how to call native library
xps2nini2000 Apr 20, 2008 11:56 PM (in response to xps2nini2000)yes my java code is calling a .so library .I want to know how to configure that path in jboss.
-
3. Re: how to call native library
peterj Apr 21, 2008 11:25 AM (in response to xps2nini2000)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. -
4. Re: how to call native library
xps2nini2000 Apr 22, 2008 4:35 AM (in response to xps2nini2000)hi
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??? -
5. Re: how to call native library
peterj Apr 22, 2008 11:06 AM (in response to xps2nini2000)"xps2nini2000" wrote:
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. -
6. Re: how to call native library
xps2nini2000 Apr 23, 2008 2:04 AM (in response to xps2nini2000)I dnt 9 which version of jboss is this?? how to check whteher it is native or nor?
-
7. Re: how to call native library
peterj Apr 23, 2008 10:18 AM (in response to xps2nini2000)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.
-
8. Re: how to call native library
xps2nini2000 Apr 24, 2008 5:41 AM (in response to xps2nini2000)I am not having jboss-native. I have set my LD_LIBRARY_PATH.Still its not working.Please tell me what shud i do.
-
9. Re: how to call native library
xps2nini2000 Apr 24, 2008 7:45 AM (in response to xps2nini2000)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
java.lang.UnsatisfiedLinkError: tr.Wrapper.execute(Ljava/lang/String;)V
at tr.Wrapper.execute(Native Method)
at tr.Wrapper.nativeCall(SMTWrapper.java:26)
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 -
10. Re: how to call native library
peterj Apr 24, 2008 1:40 PM (in response to xps2nini2000)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? -
11. Re: how to call native library
xps2nini2000 Apr 25, 2008 1:04 AM (in response to xps2nini2000)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
-
12. Re: how to call native library
peterj Apr 25, 2008 11:13 AM (in response to xps2nini2000)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?