Results 1 to 9 of 9
Thread: UnsatisfiedLinkError on dll load
- 04-10-2011, 12:41 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
UnsatisfiedLinkError on dll load
Hi Friends,
I have a sample piece of code in my application that loads a dll and use its methods...
My code runs fine for the very first time and native methods get invoked properly...
But when i try for the second time, loading dll fails with unsatisfiedlink error...if i quit and start my application, the dll load works for first time again and fails in future attempts...
I am aware that my dll is still loaded by classloader...but someone please help me to get rid of this by unloading dll each time my task is done...
Regards,
Bharath M
- 04-10-2011, 01:37 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,386
- Blog Entries
- 7
- Rep Power
- 17
Do you quit your Java program before you attempt to load your .dll again, or do you simply try to load it again in the same 'incarnation' of your Java program. Loading a .dll for a second (or third etc.) time shouldn't harm you because the documentation explicitly states: "If this method is called more than once with the same library name, the second and subsequent calls are ignored.".
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-10-2011, 07:20 PM #3
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
I quit my java program before i attempt to load my dll again...
- 04-10-2011, 08:12 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,386
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-11-2011, 06:30 AM #5
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
Not really...It works for only the first time and fails on all of the future runs...
- 04-11-2011, 10:03 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,386
- Blog Entries
- 7
- Rep Power
- 17
Ah, ok, my guess is that the OS is playing tricks on you: it doesn't unload the .dll when your application quits and no more references to the .dll exist. I don't know how to force MS Windows to immediately unload a .dll when it isn't needed anymore, sorry.
What happens if you wait a bit before you restart your application again?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-11-2011, 11:08 AM #7
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
Yes... i observed occasionally today that if i wait for some time, i get rid of this error...but dont know wat exactly needs to be done to fix this...
- 04-11-2011, 11:15 AM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,386
- Blog Entries
- 7
- Rep Power
- 17
- 04-11-2011, 11:23 AM #9
Member
- Join Date
- Apr 2011
- Posts
- 11
- Rep Power
- 0
Similar Threads
-
Java3D UnsatisfiedLinkError
By Cemi in forum New To JavaReplies: 2Last Post: 02-26-2011, 05:10 PM -
UnsatisfiedLinkError
By leepan2008 in forum Advanced JavaReplies: 4Last Post: 01-07-2011, 04:40 AM -
JNI: ava.lang.UnsatisfiedLinkError
By tecno40 in forum Java AppletsReplies: 0Last Post: 11-19-2010, 11:59 PM -
UnsatisfiedLinkError
By Hussain Ali in forum EclipseReplies: 2Last Post: 04-11-2010, 07:59 AM -
UnsatisfiedLinkError using gr.DotNetFromJava.cpp.dll
By Viter_ in forum Advanced JavaReplies: 0Last Post: 07-17-2009, 08:53 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks