“Package should contain a content type part [M1.13]”

前端 未结 11 1292
野趣味
野趣味 2020-12-19 02:36

I am attempting to write to an Excel file however I keep getting the error:

Exception in thread \"main\" org.apache.poi.POIXMLException: org.apache.po

11条回答
  •  Happy的楠姐
    2020-12-19 03:17

    Another possible solution is

    Workbook workbook = WorkbookFactory.create(source)
    

    WorkbookFactory should be provided by Apache POI you are using (if not upgrade to newer version). It recognize file format and creates concrete implementation of Workbook interface (XSSFWorkbook or HSSFWorkbook). The source parameter can be java.io.InputStream or java.io.File.

提交回复
热议问题