Java and Cascade

Hello,

I am developing an application with CASCADE 3.0 with a Java interface. To realize this, we build (using Wok) a JNI interface. The size of this Jni interface is a DLL (Gui.dll) with a size of 3130 Ko. this DLL use others DLL (around 100 others DLL). To develop this I use Visual C++, using the dependency walker of Visual studio the Gui.dll is OK. When I launch java using this command:

java -verbose:jni -ss10M -oss10M -Xcheck:jni myProgram. the load of the library is done with this code:

static {

System.loadLibrary("Gui");

}

And I obtain this message:

java.lang.UnsatisfiedLinkError: D:\EditeurGeologique\EG2000\Wnt\dll\Gui.dll: Echec d'un sous-programme d'initialisation de biblioth?que de liaison dynamique (DLL)

at java.lang.ClassLoader$NativeLibrary.load(Native Method)

at java.lang.ClassLoader.loadLibrary0(ClassLoader.java, Compiled Code)

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1243)

at java.lang.Runtime.loadLibrary0(Runtime.java:470)

at java.lang.System.loadLibrary(System.java:778)

my path contain D:\EditeurGeologique\EG2000\Wnt\dll\, so is not a pathlibrary problem.

I think that its a size problem from the Java Virtual Machine. Replacing this Dll by a load of different libraries sucha as:

loadLibrary("GDI32");

loadLibrary("GDM");

loadLibrary("GEOLOGIE");

loadLibrary("GLU32");

loadLibrary("GRID2D");

loadLibrary("GRIDGEOM");

loadLibrary("GRIDIO");

loadLibrary("GRIDTOOL");

loadLibrary("GUIGEOMETRYPACKAGE");

loadLibrary("IMAGEHLP");

loadLibrary("ISESSION2D");

loadLibrary("JCAS");

loadLibrary("KERNEL32");

loadLibrary("LDS");

loadLibrary("MFC42");

loadLibrary("MODEL");

loadLibrary("MSVCIRT");

loadLibrary("NGI");

loadLibrary("OPENGL");

loadLibrary("OPENGL32");

loadLibrary("MODELSESSION");

loadLibrary("POTENTIEL");

loadLibrary("PROJET");

loadLibrary("PROJETIO");

loadLibrary("PROJETSESSION");

with

public void loadLibrary(String library) {

System.out.println("loadLibrary: " + library);

System.loadLibrary(library);

System.out.println("Library: " + library + " loaded");

}

I have the same problem when I have load around 20 of these libraries.

Some Body can help me ?

Yan's picture

Perhaps you should try theses: 1. Place the above dll files in a wok toolkit say TGEG that will produce TKEG.dll and load TKED.dll say in the main static class. If it works and if it does not ecrabouille performances perhaps it should a way for bypassing your problem ?

Guillen Antonio's picture

Hello,

I found the solution to the problem. On NT there is a limit on the number of DLL that you can load. Sucha as Cascade plus NT represent something around 50-60 DLL, if your application is more than 50-60 DLL it's impossible to load the libraries. The total limit seems to be 113 DDL in one application.

Antonio Guillen