В настоящее время я пытаюсь прочитать файл .xls из java, в первой строке которого есть символ '°', но я получаю сообщение об ошибке в конструкторе HSSFWorkbook.
FileInputStream fileInputStream = new FileInputStream(new File(path));
HSSFWorkbook workbook = new HSSFWorkbook(fileInputStream);
Я получаю:
org.apache.poi.hssf.record.LabelRecord cannot be cast to java.lang.Comparable
Если я удаляю символ '°'
, все работает нормально.
Полная трассировка стека:
java.lang.ClassCastException: org.apache.poi.hssf.record.LabelRecord cannot be cast to java.lang.Comparable
at java.util.TreeMap.put(Unknown Source)
at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.insertCell(ValueRecordsAggregate.java:65)
at org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.construct(ValueRecordsAggregate.java:130)
at org.apache.poi.hssf.model.Sheet.createSheet(Sheet.java:210)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:172)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
at adp.servlet.UploadPPIPServlet.readExcel(UploadPPIPServlet.java:342)
at adp.servlet.UploadPPIPServlet.process(UploadPPIPServlet.java:87)
at frmw.BaseServlet.doPost(BaseServlet.java:283)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:612)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:503)
at java.lang.Thread.run(Unknown Source)