尝试打开excel文件时,Apache Poi崩溃

时间:2015-09-02 22:14:34

标签: java excel apache-poi

对于使用MS-Office保存的一些有效文件,这行代码为:

Workbook workbook = tableFileImporter.createNewWorkbook();

导致以下异常:

java.lang.NullPointerException
        at org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:236)
        at org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:166)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:278)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:250)
        at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:229)
        at service.fileimport.TableFileImporter.createNewWorkbook(TableFileImporter.java:31)
        at controller.EmpfehlungenController.importStipendiaten(EmpfehlungenController.java:164)
        at controller.EmpfehlungenController.access$0(EmpfehlungenController.java:132)
        at controller.EmpfehlungenController$1$1.execute(EmpfehlungenController.java:85)
        at view.dialog.dispatchable.ProgressbarDialogDispatcher$1.run(ProgressbarDialogDispatcher.java:59)
        at java.lang.Thread.run(Unknown Source)

使用Libre创建的文件我从未发现过问题。 也许问题与此question有某种关系。

你建议我做些什么来修复它?

0 个答案:

没有答案