-
-
Notifications
You must be signed in to change notification settings - Fork 36
Loading the POI java libraries
This library is essentially a wrapper for the spreadsheet functionality available in the Apache POI Java API and needs the POI and other supporting java libraries ("jars") to be "loaded" so that they can be invoked.
However if your CFML engine already uses older versions of any of these libraries, conflicts may arise.
To ensure this doesn't happen Lucee (from version 2.14.0 of the library) loads the jars using OSGi from a specially provided "bundle" (lib-osgi.jar
) which is included in the root.
The OSGi bundle is automatically installed to Lucee the first time it runs and will appear in your server administrator's "Info -Bundle (jar)" list as:
Spreadsheet CFML (spreadsheet-cfml)
The bundle can be uninstalled by calling the following method on the library:
spreadsheet = New spreadsheetLibrary.Spreadsheet();
spreadsheet.flushOsgiBundle();
Use of lib-osgi.jar
in Lucee means that you do not need the lib
or javaLoader
folders that come with the library.
If you are using Adobe ColdFusion the jars are loaded using JavaLoader to ensure the correct versions are used.
If you are using ColdFusion and would prefer not to use JavaLoader (perhaps for security reasons) you have the option of doing this as long as you are happy to customise your engine's installation to avoid version clashes. You will need to:
- Remove the existing POI and other jars from your engine's core java class path.
- Ensure the jars in the
/lib
folder of the Spreadsheet Library are added to your engine's java class path. - Pass the following parameter to the Spreadsheet Library's
init()
method:
spreadsheet = New spreadsheetLibrary.spreadsheet( requiresJavaLoader=false );
If JavaLoader is required for your environment and you already have a copy available on your server, you can configure the library to use that instead of the bundled version. Simply specify the dot path of the JavaLoader.cfc
component as the javaLoaderDotPath
init argument. For example:
spreadsheet = New spreadsheetLibrary.spreadsheet( javaLoaderDotPath="myLibrary.javaloader.JavaLoader" );