I used jni4net and created a j4n.dll and a j4n.jar. eclipse understands the imports when I try to instantiate an object using a new button like ISslTcpClient sslTcpClient = new SslTcpClient();
I get an error as follows:
Exception in thread "main" java.lang.UnsatisfiedLinkError: firstdata.icvtnsclient.SslTcpClient.__ctorSslTcpClient0(Lnet/sf/jni4net/inj/IClrProxy;)V at firstdata.icvtnsclient.SslTcpClient.__ctorSslTcpClient0(Native Method) at firstdata.icvtnsclient.SslTcpClient.(SslTcpClient.java:25) at program.JNI4NETexample.main(JNI4NETexample.java:46)
Why am I getting this error? Thank you for your help in advance.
HERE ARE ADDITIONAL INFO:
I adds my J4n.jar in the build path and all the dll files plus the jar files in the root folder before the source.
AND HERE IS THE CODE: SslTcpClient sslTcpClient=new SslTcpClient(); is the line that gives me dificulty.
package program ;
import net.sf.jni4net.Bridge;
import java.io.File;
import java.io.IOException;
import java.lang.String;
import system.Console;
import system.collections.IDictionary;
import system.collections.IEnumerator;
import system.io.TextWriter;
import firstdata.icvtnsclient.ISslTcpClient;
import firstdata.icvtnsclient.SslTcpClient;
/*import system.*;
import system.Object;
import system.io.TextWriter;
import system.collections.IDictionary;
import system.collections.IEnumerator; */
//This example is from the JNI4net example
public class JNI4NETexample implements ISslTcpClient {
// {System.loadLibrary("ICVTnsClient.j4n");} //do not use .dll for loadlibrary
public static void main(String[] args) throws IOException {
// create bridge, with default setup
// it will lookup jni4net.n.dll next to jni4net.j.jar
try {
Bridge.setVerbose(true);
Bridge.init();
// Bridge.LoadAndRegisterAssemblyFrom(new File("ICVTnsClient.dll"));
Bridge.LoadAndRegisterAssemblyFrom(new File("ICVTnsClient.j4n.dll"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SslTcpClient sslTcpClient=new SslTcpClient();
String csEncryptedString = sslTcpClient.Encrypt("C1 2005 151601 4111111111111111 0703 84.00");
System.out.println("THIS IS THE ASNWER "+ "csEncryptedString");
}
public String Decrypt(String arg0) {
// TODO Auto-generated method stub
return null;
}
public String Encrypt(String arg0) {
// TODO Auto-generated method stub
return null;
}
}