java.lang.UnsatisfiedLinkErrorplease help me its very urgent
Hi all,
In my application i am trying write errrors in to windows application log. so i created a simple java standalone application to simulate that . Its runs fine by using java command .
After that i integrated that to my application .there i am getting error
java.lang.UnsatisfiedLinkError: InitializeApplicationLog
it shows that it successfully loaded the dll file. and while running methods it giving error.
please help me to solve this issue
Its very urgent. I am struggling from 3 days.
-
1) I copied WindowsEventWrapper.dll (already exist) in to C:\/WindowsAppLogDLL folder
2) created one java wrapper class with the name WindowsEventWrapper.java
publicclass WindowsEventWrapper
{
publicnativelong InitializeApplicationLog(String applicationName, String resourceFilename)
throws java.lang.RuntimeException, java.lang.IllegalArgumentException, java.lang.OutOfMemoryError;
publicnativevoid LogApplicationEvent(long logHandle, String applicationEvent,
int eventIdentifier,int eventLevel)
throws java.lang.RuntimeException, java.lang.IllegalArgumentException, java.lang.OutOfMemoryError;
}
3) this is the code to call to native metods
WindowsEventWrapper winWrapper =null;
try
{
System.load("C:/WindowsAppLogDLL/WindowsEventWrapper.dll");
System.out.println("dll loaded");
}
catch (Error ee)
{
System.out.println("Error"+ee);
System.out.println("Loading _wrapperDLLName dll failed, check PATH");
}
if(winWrapper==null)
{
System.out.println("WINwRAPPER was NULL and now object created");
winWrapper =new WindowsEventWrapper();
}
try
{
moduleKey = winWrapper.InitializeApplicationLog("CEMTestLog","C:\\MyTrials\\MyMessages.dll" );
winWrapper.LogApplicationEvent(moduleKey,"Sample error message",32354, 0);
}
catch ( UnsatisfiedLinkError e1 )
{

