Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

java.lang. UnsatisfiedLinkError

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic