Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang. UnsatisfiedLinkError

 
Liz Costelloe
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to link an applet to a Fortran DLL through a servlet using JNI. Originally I tried to directly communicate between the Applet and Fortran however security permissions were blocking the communication. The sun tutorial on Applets does mention that applets can't do this.

So I've introduced a Servlet to allow the Applet and Fortran to communicate. My problem at the moment is that I get the following error when I try to load the dll to the Servlet:

java.lang.UnsatisfiedLinkError: no fortran.dll in java.library.path

I'm using the following command to load the DLL

System.loadLibrary("fortran.dll");

I've tried replacing fortran.dll with

http://aserver:8080/structures/fortran.dll

I've also tried editing system.library.path to include the address of the server.

I'd very much appreciate any suggestions on this,
Many thanks.
[ June 06, 2006: Message edited by: Liz Costelloe ]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you follow the trail through the JavaDocs, you end up at findLibrary

The loadLibrary method depends on the system variable java.library.path which for most servers isn't set to anything. If you read through the documentation of your server, each has a way to set system variables at startup time. Tomcat, you add a system variable called TOMCAT_OPTS something like
set TOMCAT_OPTS=-Djava.library.path=[path to dll]
startup
 
Harpreet Hira
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try including the path of DLL in PATH environment variable OR
Else, if you are on Windows OS, put it in System32 folder.
 
Liz Costelloe
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your responses. Problem solved, I've put the DLL in the system32 folder for the moment and it's loading with no problems now.

I'll look into setting java.library.path now that I know the DLL works and isn't the source of the problem.

Many thanks, very grateful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic