Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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#">