aspose file tools*
The moose likes JBoss/WildFly and the fly likes UnsatisfiedLinkError in JBoss while calling a JNI method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "UnsatisfiedLinkError in JBoss while calling a JNI method" Watch "UnsatisfiedLinkError in JBoss while calling a JNI method" New topic
Author

UnsatisfiedLinkError in JBoss while calling a JNI method

Ravi Choudhari
Greenhorn

Joined: Aug 03, 2010
Posts: 9
Hi,

I am getting the UnsatisfiedLinkError when calling a JNI method in JBoss 5.1

The required .dll file is in LD_LIBRARY_PATH

I have also set jna.library.path & java.library.path to the directory which has the required .dll

I have also tried to place the dll in windows\system32, jre6\lib\ext, jdk\jre6\lib\ext and jboss\bin, but getting the same error.

But there is no error if I call the methods from a standalone java application.

Also, The same method call is working perfectly in Tomcat if the dll is copied to windows\system32.


Thanks,
Ravi
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

LD_LIBRARY_PATH is not used on Windows. The DLL should either be in the PATH or be in the java.library.patch system property. Check run.bat for setting java.library.path.


JBoss In Action
Ravi Choudhari
Greenhorn

Joined: Aug 03, 2010
Posts: 9
The DLL is in the PATH & in java.library.path, also it is present in bin directory of jboss. But still getting same error.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Set _JAVA_LAUNCHER_DEBUG (you can set it to anything). Then start the app server. The JVM loader will dump some stuff to the console. Make sure that the java.library.path setting gets dumped and that it includes the directory containing you DLL.

If that does not help you resolve the problem, post the full path name for the DLL and post what was output to the console.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

One other thought - does the DLL depend on other DLLs and are those DLLs also in the PATH? One way to check this is to use the Dependency Walker tool (http://www.dependencywalker.com/).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnsatisfiedLinkError in JBoss while calling a JNI method