• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

where to place JNI dll for web applications

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 443
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Sheriff
Posts: 22650
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic