Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Servlet and JNI

Status
Not open for further replies.

fmorel

Programmer
Apr 24, 2002
123
CH
I tested a JAVA API that does JNI in a standard JAVA application and it works properly.
I have problems using it in a servlet : I get an error message: "java.lang.UnsatisfiedLinkError: no xxx in java.library.path" where xxx is the name of a dll used by the JAVA API.

I know that this problem is linked with path or classpath. How do I set the path/classpath in the servlet context ?

Thanks a lot for answers !
 
Going by memory, i found in a Windows environment the OS Path mechanism was used to load the native library, which would actually make sense.

-pete

 
Thanks a lot for your answer palbano.
I am on a windows environment too.
The path to the DLL is in the OS PATH.
I tried to copy the missing dll file to C:\WINNT and it worked (but it is not very satisfied by this workaround ...).
- So why does it look in C:\WINNT and not in the PATH ?

This JAVA API also needs some specific environment variables to be set before it can be used.
How can these environment variables be seen by the servlet?

 
I don't have any idea why it would not find the DLL if the path was correct. I believe that was the behavior that i found.

>> This JAVA API also needs some specific environment
>> variables to be set before it can be used.
>> How can these environment variables be seen by the
>> servlet?

If your referring to Java system properties i believe you should be able to set them in the web.xml file entries for the servlet. I can't help you with the specific web.xml syntax for that since i am unsure what it is.

-pete

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top