I'm currently trying to call .NET code using jni4net.
I've managed to create the proxy classes from a .NET .dll using proxygen. However, this code:
Bridge.init();
Bridge.LoadAndRegisterAssemblyFrom(new File("clAESEncripcion.j4n.dll"));
aesencryption.AESObjectEnc aesObjectEnc = new aesencryption.AESObjectEnc();
aesObjectEnc.Encrypt(new Ref<String>("To encrypt"));
Throws the following exception:
Exception in thread "main" java.lang.IncompatibleClassChangeError
at aesencryption.AESObjectEnc.Encrypt(Native Method)
at clAESEncripcion.MainApp.main(MainApp.java:19)
at net.sf.jni4net.jni.JNIEnv.ExceptionTest()(:0)
at net.sf.jni4net.jni.JNIEnv.CallIntMethod()(:0)
at net.sf.jni4net.inj.__IClrProxy.getClrHandle()(:0)
at net.sf.jni4net.inj.__IClrProxy.GetObject()(:0)
at net.sf.jni4net.utils.Convertor.StrongJp2CString()(:0)
at net.sf.jni4net.utils.Convertor.FullJ2C()(:0)
at net.sf.jni4net.Ref.GetValue()(:0)
at AESEncryption.__AESObjectEnc.Encrypt1()(:0)
I'm currently workging with jdk1.7.0_75 64bits ,Microsoft.NET\Framework64\v4.0.30319 and jni4net-0.8.6.0.
The AESObjectEnc C# class of the dll has an Encrypt method which expects a String ref.
Thanks in advance.