• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

UnsatisfiedLinkError on JBoss calling a JNI native method

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I'm having problem deploying a simple JNI Web App on JBoss 4.0.5.

The required .dll files are in the path.

When my Servlet tries to invoke the native method, it gives me the UnsatisfiedLinkError.

Needles to say, it works just fine in a standalone application.

What am I doing wrong ? Please let me know the solution for this problem. I am struggling from 2days to rectity this problem.

Thanks in advance,
Aresh babu
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in winsows you have to set the PATH variable ( in server startup script ) in unix you set shared library as LD_LIBRARY_PATH . I am not sure if you have to use jvm args -Djava.library.path . post a detail description of how are you starting the server and setting the path variable .
 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kripal,

In the java program itself i am setting the classpath in the follwing way

System.setProperty("java.library.path","dllfilename.dll");
System.loadLibrary("dllfilename.dll");

But i am not able to call a native method. While calling the native method it is giving the exception.

I have set the classpath in run.bat file also. Now also i am getting the same exception.

Please help me in this regard.

Thanks & Regards
Aresh Babu A
 
Kripal Singh
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to set the path variable i run.bat if you are using windows

some thing like
path = %PATH%;newdir

or path= %PATH%;C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

set the path variable before you set any other variable like CLASSPATH or VM args .
 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Kripal,

now also i am getting the same exception.
Can you please tell me why i am getting this exeception??

Thanks
Aresh Babu
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not able to find few of the libs in common directory.
can you please attach a stack trace.
 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

sorry i am not able to attach the stack trace.
Can you please tell me how to rectify this error..

Thanks
Aresh Babu
 
sachin burange
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what happens with your case.
I have encountered this error couple of times. There may be following reasons

- In you app their may be duplicate jar files container different versions.
- check shared lib of JBOSS server.
- Try using fresh JBOSS server and fresh deployment.

Regards
sachin
 
Evacuate the building! Here, take this tiny ad with you:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic