JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
November 22, 2019, 09:38:22 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: Running 3rd party application which uses JNI hungs (throws exception?) on node  (Read 2073 times)

kevin.roy

  • Guest

We want to create a job which will run a c++ application.  We want to use zeroMQ to communicate between the testTask and the C++ application.  Please see the attached code.

When the testTask tries to execute ZMQ.context(1) (which is JNI code).  The testTask appears to hung.

We saw similar problem when we tried to use JNI code to run our C++ function.  When the second job called the System.loadLibrary("libraryName") the jppfTask code seemed to stop executing. 
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2257
    • JPPF Web site

Hello,

I suspect the cause of the problem is that the library you're trying to load cannot be found.
To check this, can you try to surround your System.loadLibrary("libraryName") with a try{} catch{} block, for example like this:

try {
  System.loadLibrary("libraryName");
} catch(Error e) {
  e.printStackTrace();
  throw e;
}

I made a simple test on my side and got the following error:

java.lang.UnsatisfiedLinkError: no eclipse_1406 in java.library.path
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
  at java.lang.Runtime.loadLibrary0(Runtime.java:823)
  at java.lang.System.loadLibrary(System.java:1028)
  at test.node.nativelib.NativeLibTask.run(NativeLibTask.java:49)
  ... 7 more

Basically, this means my library cannot be found in any of the paths specified by the system property "java.library.path".
On Windows, this property is a copy of the PATH environment variable, and on Linux it is a copy of LD_LIBRARY_PATH. See this article for more details.
So to successfully load the library, you have to either add its directory to the PATH or LD_LIBRARY_PATH environment variable, or move it to a directory that is already in the envrionment variable.

Could you let us know if this is the problem you are facing?

Sincerely,
-Laurent
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads