I'm using jni4net, I'm reading a .NET dll in a java application, and it works when I run direct on the main method. Below is an example:
public static void main( String[] args ) throws IOException {
Bridge.setVerbose(true);
Bridge.init();
File dllFile2 = new File("Cripto.j4n.dll");
Bridge.LoadAndRegisterAssemblyFrom(dllFile2);
...
...
}
However, when I try to run from the following webservice below
@GET
@Path("/conect")
public String conect() throws IOException {
Bridge.setVerbose(true);
Bridge.init(); //the error is triggered at this point
...
...
}
The following error is posted:
Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
I've already tried to point the path of dll Cripto.j4n.dll indicating the absolute path but it did not work, below the example of my attempt:
Bridge.init(new File("C:\\apps\\MyApp\\Cripto.j4n.dll"));
Bridge.init(new File("Cripto.j4n.dll")); //also tried this way
Anyway, I need to make the calls from .dll on webService, the server is a wildfly 9, how do I? any hint?
I was able to find the solution.
I was pointing directly to the .dll file, and besides, I pointed to the .dll wrong, he was looking for the "jni4net.n-0.8.5.0.dll" and not the "Cripto.j4n.dll" (which was the file I created), so the solution was to point out the folder where the "jni4net.n-0.8.5.0.dll" was like this:
I DID NOT REPORT THE FILE , BUT THE FOLDER WHERE IT WAS "jni4net.n-0.8.5.0.dll"