File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes General Computing and the fly likes java. lang. UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "java. lang. UnsatisfiedLinkError" Watch "java. lang. UnsatisfiedLinkError" New topic

java. lang. UnsatisfiedLinkError

karolos ignatiadis

Joined: Nov 15, 2003
Posts: 25

I have the following problem:

When I execute "java main" a window pops up with the following error:

Microsoft Visual C++ Debug Library

Debug Assertion Failed!

Program: c:\j2sdk1.4.2_09\bin\java.exe
File: app3ds.cpp
Line:32 ASSERT(!afxContextIsDLL); // Should only be called by apps

If I press "Ignore" I then get a "java.lang.UnsatisfiedLinkError: D:\...\Hmi_HITDlg.dll: A
dynamic link library (DLL) initialization routine failed."

If I press "Retry" I get a java.lang.UnsatisfiedLinkError: D:\..Hmi_HITDlg.dll: One or more
arguments are invalid.

What I am actually trying to do is call a C++ function from Java using JNI (JNI code is generated using SWIG).

Here is my C++ function (in HMI_HITDlg.cpp):

float get_LongVel() {
return myInput.Vehicle.LongVel;

This is my JNI code (in HMI_HITDlg_wrap.cxx)

JNIEXPORT jfloat JNICALL Java_Hmi_1HITDlgJNI_get_1LongVel(JNIEnv *jenv, jclass jcls) {
jfloat jresult = 0 ;
float result;

result = (float)get_LongVel();

jresult = (jfloat)result;
return jresult;

This is the code where I am loading the dynamic link library Hmi_HITDlg.dll (contains HMI_HITDlg.cpp and HMI_HITDlg_wrap.cxx
and other necessary files and is made using Visual C++ 6.0, from File->New->Projects->Win32 Dynamic-Link Library) in



The size of the DLL that I am loading is approx. 2.04MB .

What is going on here? Please help!!
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

It sounds like your JDK install (or one of the libraries it uses) is corrupted - I'd try to delete and re-install and see if it helps.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: java. lang. UnsatisfiedLinkError
It's not a secret anymore!