I'm exporting data as an excel document. Everything works as expected when run locally, but is failing with the following error message when deployed to tomcat:
java.lang.ClassCastException: my.cool.ExportService cannot be cast to builders.dsl.spreadsheet.builder.api.WorkbookDefinition
at my.cool.ExportService$__tt__createExcel_closure3.doCall(my.cool.ExportService.groovy:74)
The code with the error looks like:
class ExcelExportService {
public static final String EXCEL_FILE_SUFIX = ".xlsx"
public static final String EXCEL_FILE_PREFIX = "stuff"
def exportExcel(OutputStream outs, List<Stuff> stuffList) {
File file = File.createTempFile(EXCEL_FILE_PREFIX, EXCEL_FILE_SUFIX)
PoiSpreadsheetBuilder.create(outs).build {
apply MyExcelStylesheet
....
I'm exporting data as an excel document. Everything works as expected when run locally, but is failing with the following error message when deployed to tomcat:
The code with the error looks like: