Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Service cannot be cast to builders.dsl.spreadsheet.builder.api.WorkbookDefinition when deployed to tomcat 9 #11

Open
ddelponte opened this issue Nov 14, 2019 · 2 comments

Comments

@ddelponte
Copy link

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
....
@musketyr
Copy link

Hello. Thank you for reporting. Can you give me more details?

  • is the code compiled statically using @CompileStatic
  • what version you are using?

@musketyr
Copy link

BTW thanks for the reminder that version 2.0.0 hasn't been released officially yet.

Can you try to upgrade to 2.0.0 and tell me if there is any change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants