Wednesday August 31, 2005 This came up in the forum over the last week.
The easiest way to get access to native code from a Creator application is when that code can be handled as a global resource similar to a JDBC driver jar.
I created a little test case today (on Linux) and that seemed to work after the following steps:
Created a libmarco.so and libmarco.jar, The Java code does a
static { System.loadLibrary("marco"); }
Copied both into
For Creator set the LD_LIBRARY_PATH to the directory where the libmarco.so is. (Is this PATH for Windows?)
For the project, add the libmarco.jar as library for the design time only! I believe that can somehow be added to a customized template if it's needed in more than one project.
Use the library (mine just returns a String from the native side;-) and deploy the application.
That worked for me;-)
Trying to handle a native library as part of a WebApplication is probably a lot harder. Things to watch out for would at least include:
The Java wrapper code has to find the native library relative to it's classloader.
The security manager of the container will probably have to be changed to allow loading of native libraries from applications.
The initialization code on the native side and the Java side have to be able to handle `redeployments'.
What would the container do when an undeploy attempt tries to delete a loaded native library?
So overall I don't think that would be a good idea.
I hope this helps a bit;-)
( Aug 31 2005, 04:27:57 PM PDT ) Permalink Comments [0]