1

I have a c# DLL, i convert that dll from JNI4net to work with java. I am able to call the dll in java but when i create a jar file and trigger java function from oracle on button event. It throws exception.

Java code:

    Bridge.setVerbose(true);
    Bridge.setDebug(true);
    Bridge.LoadAndRegisterAssemblyFrom(new java.io.File("ECR.j4n.dll"));
    ComECR test = new ComECR();
    test.VFI_DoSetup();

ORACLE Exception :

java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.<init>(Unknown Source)
at net.sf.jni4net.CLRLoader.findDefaultDll(CLRLoader.java:54)
at net.sf.jni4net.Bridge.init(Bridge.java:31)
at com.ecr.test.Program.getProperty(Program.java:57)
at oracle.forms.handler.UICommon.onGet(Unknown Source)
at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
at oracle.forms.engine.Runform.processMessage(Unknown Source)
at oracle.forms.engine.Runform.processSet(Unknown Source)

I have signed jar and also added the jar in class path and formsweb.cfg

need help on this

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
  • I don't think you can load the .DLL from the jar directly. It looks like you need to extract it from the jar first and then call it. Example here: http://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-includes-dll-files – Mike Apr 17 '16 at 13:37
  • My java code is running perfect.. It call the c# dll.. But i am unae to linked the jar with oracle, it give me exception which i mention above – user1593373 Apr 17 '16 at 14:01

1 Answers1

0

You have this very message error in SO: URI scheme is not "file"

From your error, I would try the below:

Bridge.setVerbose(true);
Bridge.setDebug(true);
Bridge.LoadAndRegisterAssemblyFrom(new java.io.File("file:<fullpath>/ECR.j4n.dll"));
ComECR test = new ComECR();
test.VFI_DoSetup();

The fact that you're getting the error with Oracle only could mean Oracle doesn't work with same Path as Java alone. It isn't missing the jar file's path but the dll one's.

Community
  • 1
  • 1
J. Chomel
  • 8,193
  • 15
  • 41
  • 69