POI Libraries don't work well using Lucee

Hi everyone, I was trying to migrate my code from ColdFusion to Lucee but I encountered this error :Error].
In ColdFusion it works perfectly, here is the part of the code where I try to use the POI library:Code.

My questions are:
-where can I put my POI librares to make Lucee recognize them?
-which POI version works with Lucee?

Java Version: 11.0.16
Lucee Version: 5.3.9.166

1 Like

We’re just updating our POI libraries to the 5.2.3 version. Although we only really use them to read/write XLS files they’re working OK at the moment.

We run Lucee in the Tomcat Docker images, so we place the POI libraries in /usr/local/tomcat/lucee/ which is where our/the lucee.jar file lives.

HTH

it’s not the latest |POI version, but there is a POI extension with v5

https://download.lucee.org/#64B91581-2F6D-4316-8F21279369EB6F82

1 Like

You can use any version of POI with Lucee but obviously your code will need to match.

As Zac says, there is a specific POI Lucee extension (scroll down or search for POI) which is probably the easiest way to install and use it. That currently has POI v5.0.0. You would call methods on it using the bundle name as the 3rd argument to CreateObject() to make sure you avoid any conflicts:

CreateObject( "java", "[POI CLASS]", "org.lucee.poi" )

For example:

version = CreateObject( "java", "org.apache.poi.Version", "org.lucee.poi" )
dump( version.getVersion() )

I am biased, but if you just want to work with spreadsheets then you could save a lot of bother by using the Spreadsheet CFML library which handles all the loading for you and uses the latest POI release.

2 Likes

100% and if there’s something missing, file a PR

1 Like