• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI: The specified procedure could not be found.

 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I think everyone who has ever worked with JNI has seen this error at some point "UnsatisfiedLinkError The specified procedure could not be found."

I have a problem where I have an existing JNI library ( C++/Windows) that has worked for some time. I recently upgraded the compiler and rebuilt the JNI library. Now I get the above error. The environment has not changed, except for the newly built .dll and maybe some other .dlls that it depends on. The .dll is being found because I debugged from where the Java class calls System.loadLibrary() and the path to the .dll is resolved correctly. The problem comes when the ClassLoader actually tries to load it. I don't understand what "specified procedure" it means. No procedure is even being called. The problem happens when the library is being loaded not when I try to call a native method in the library. I cannot debug any further because I get to the native call that actually does the load and of course I cannot do any more. Is there any way to get more information so that I can figure out what the problem is or maybe someone has had a similar issue and can provide some hints?

many many thanks!

B
 
dave barker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm curious how you resolved this problem, as I'm having the same problem. The JVM sees the dll but I get the message:

"Couldn't load library:java.lang.UnsatisfiedLinkError: C:\WINDOWS\JMatLink.dll: The specified procedure could not be found"

and no procedure is being called in the dll that I know of. At least the Java code isn't calling any.

Thanks for any help!
 
John The Doe
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how Barry Andrews solve his problem, but I can share the knowledge how I solve mine :-)

Inside my DLL I used WinAPI function available only in Windows Vista (and later). However I was running the application under Windows XP....

The tool that helps me solving my problem - http://dependencywalker.com
Check your DLL with it, and you must NOT have any errors like "At least one module has an unresolved import due to a missing export function in an implicitly dependent module".
It may be OK if you have problems with delay-load modules (missing delay-load dependencies are not a problem as long as the calling DLL is prepared to handle the missing module - see the dependencywalker FAQ)

Cheers,
thexman
 
Ondrej Kováč
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that the "specified procedure" referes to some missing function which your library requires. You can see that in the Dependency Walker.
You can see that LIBINET.DLL in the attached image is highlited with red and when you click on it you can see missing functions. This was because I have used an older version of LIBINET.DLL library.
Untitled.png
[Thumbnail for Untitled.png]
Missing functions in LIBINET.DLL
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!