728x90
반응형
POI 를 사용해서 액셀 문서 파싱 할 때 발생할 수 있는 에러
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
at org.apache.poi.poifs.storage.HeaderBlock.<init>(HeaderBlock.java:130)
at org.apache.poi.poifs.storage.HeaderBlock.<init>(HeaderBlock.java:117)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:294)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:401)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:382)
at com.rsn.POMS.api.dictionary.pattern.waiting.service.PatternWaitingExceelService.getPattern(PatternWaitingExceelService.java:49)
at com.rsn.POMS.api.dictionary.pattern.waiting.service.PatternWaitingExceelService.excelUploadByPattern(PatternWaitingExceelService.java:25)
at com.rsn.POMS.api.dictionary.pattern.waiting.controller.PatternWaitingController.excelUploadByPattern(PatternWaitingController.java:60)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invo
xlsx 파일을 HSSFWorkbook 을 사용해서 파싱할 경우 에러 발생
XSSFWorkbook 로 파싱하면 에러 해결 !
728x90
반응형
'개발중 > troubleshooting' 카테고리의 다른 글
org.springframework.dao.InvalidDataAccessApiUsageException (0) | 2021.12.18 |
---|---|
Java Project DB 연결 ( myBatisConfig.xml, application.properties ) 에러 ( "org.apache.ibatis.mapping.Environment.getDataSource()" because "environment" is null ) (0) | 2021.12.15 |
🧙♂️maven build / install 에러 / m2 🧙♂️ (0) | 2021.12.06 |
URI too long 414 / put 해결 하고 싶습니다. (0) | 2021.11.19 |
npm install 에러 (0) | 2021.11.08 |