Java System.loadLibrary w/ GlassFish application server

** The following is a helpful note from a Chilkat customer using the Chilkat Java API in a GlassFish environment:

FYI I managed to solve the problem. The following is what I did (in case you may want to help others with a similar need in future) to enable the RSA component to run within a Java EE6 web application using GlassFish v3

1. Copy the Chilkat native library to a path listed in java.library.path. The default on a Mac (OS X 10.6) is \System\Library\Java\Extensions.

2. Create a singleton class object in Java and place the call System.loadLibrary(String) within a static block (i.e. static { try { System.loadLibrary(“chilkat”); } catch (UnsatisfiedLinkError e) {//say or do something clever}}). There is excellent guidance about creating singletons at http://www.javacoffeebreak.com/articles/designpatterns/index.html and https://www.securecoding.cert.org/confluence/display/java/MSC07-J.+Prevent+multiple+instantiations+of+singleton+objects. Also create all necessary component manipulation methods (e.g. encrypt/decrypt) within the singleton.

3. Compile the singleton class into a jar file and make it available to the web application as a library resource.

4. Call the singleton from a convenient web application bean.