Skip to content

Loading the POI java libraries

Julian Halliwell edited this page Oct 3, 2018 · 21 revisions

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 will arise.

To avoid this, JavaLoader will be used by default to load the jars and ensure the correct versions are used.

Avoiding JavaLoader by customising the contents of your Java Class Path

If you 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:

  1. Remove the existing POI and other jars from your engine's core java class path.
  2. Ensure the jars in the /lib folder of the Spreadsheet Library are added to your engine's java class path.
  3. Pass the following parameter to the Spreadsheet Library's init() method:
spreadsheet = New spreadsheetLibrary.spreadsheet( requiresJavaLoader=false );

Using an existing copy of JavaLoader

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" );

Clone this wiki locally