• Post Reply Bookmark Topic Watch Topic
  • New Topic

where to place JNI dll for web applications  RSS feed

 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I had to use JNI in my web application.Iam loading the dll with LoadLibray("RemoteSystem") call.It was not able find the DLL. I tried with java.library.path,but no use. Where to put the DLL(native methods) for web applications....
[ April 23, 2008: Message edited by: Pratap Chowdary ]
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To use JNI, you have to create a separate class which must not be
servlet then embed this new class in servlet to perform your task and at
last forward to jsp.

By the way,your question is more distributed programming related than Jsp related question.

If you had put your question on Distributed section,you would have got
better response.

best regards,
omi
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did the same way... I have used plain java class.The problem is not able to locate the dll,not the security .......

Iam not using distributed computing.My Web application is tightly coupled with windows operting system.


I filled entire web application with that DLL,still it is not working....
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following trick works for non servlets , get your servlet to create a file (just filename) then look for that file which ever directory its in thats where your DLL should have been ;-).

As a proper solution its possibly best to including it from a jar, webstart apps I believe have a special classloader variant that allows load dll from zip/jar if you don't have that with a servlet you can use your class loader for your servlet to get a relative resource .. dll inside zip uncompress it to a temp directory and then load that with the path, look for code on the internet (i've had all three methods working albeit they weren't servlets but should be the same issues)
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use System.load() (not loadLibrary) with the full filename. The full filename can be created using the ServletContext object:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!