Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to reference a .Net COM dll in java. I have used jni4net libraries for the same. I have followed the steps mentioned in the video below : 

https://www.youtube.com/watch?time_continue=351&v=8OoSK_RWUe4

I have followed all the steps required to reference jni4net libraries but i get the following runtime Exception:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: orionforpython.DynamicOrion.__ctorDynamicOrion0(Lnet/sf/jni4net/inj/IClrProxy;)V
	at orionforpython.DynamicOrion.__ctorDynamicOrion0(Native Method)
	at orionforpython.DynamicOrion.<init>(DynamicOrion.java:25)
	at com.orion.OrionForJava.main(OrionForJava.java:16)

After following all the steps, This is my code:

        package com.orion;
        import net.sf.jni4net.Bridge;
        import orionforpython.*;
        import java.io.*;
        class OrionForJava {
        public static void main(String[] args) throws IOException {
		Bridge.setVerbose(true);
        Bridge.init();
        File proxyAssemblyFile=new File("OrionForPython.dll");
        Bridge.LoadAndRegisterAssemblyFrom(proxyAssemblyFile);
        DynamicOrion orion=new DynamicOrion();
    	String res=orion.ReqLogin("user", "pwd", "");
        System.out.print(res);
      }}

I have tried executing the same using NetBeans 8.1 IDE but with no success. I am using jni4net-0.8.8.0 version and Eclipse IDE for Java Developers
Version: Oxygen.3 Release (4.7.3)
Any assistance would be helpful!


What I have tried:

I have gone through possible solutions i found online like Checking the build path, checking that both JVM version and dll version are same i.e either both are 32 bit or 64 bit. Please note that the dll is a .Net COM DLL. I cannot use JNIBridge or JNIBridgePro
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900