Skip to main content
bemerson71
Participant
September 18, 2014
Question

Errors with CFSpreadsheet

  • September 18, 2014
  • 1 reply
  • 515 views

When using CF10 and the CFSpreadsheet tag, we're receiving the following error:

Class org.apache.poi.hssf.usermodel.HSSFWorkbook does not implement the requested interface org.apache.poi.ss.usermodel.Workbook

The simple code works on other servers, so I think there is something wrong with the server config. Any ideas?

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    August 6, 2015

    We had that error as well, and found that we had more than one version of POI lurking in other files.

    Try this code to find where the POI calls are coming from and remove any old versions:

    <cfset poi = createObject("java", "org.apache.poi.Version")/>

    <cfoutput>#poi.getVersion()#</cfoutput>

    <cfdump var = "#poi#">

    <cfset WorkBook = CreateObject(

                    "java",

                    "org.apache.poi.hssf.usermodel.HSSFWorkbook"

                    ).Init()>

    <cfdump var = "#WorkBook#">

    <cfset loader = WorkBook.class.getClassLoader()>

    <cfdump var = "#loader#">

    <cfset res = loader.getResource("org/apache/poi/hssf/usermodel/HSSFWorkbook.class")>

    <cfoutput>#res.getPath()#</cfoutput>

    <cfset poixml = createObject("java", "org.apache.poi.POIXMLDocument")>

    <cfdump var = "#poixml#">