Apache POI奇怪的行为

时间:2014-02-08 07:27:20

标签: java excel apache-poi

您可以查看以下图片,细胞内容&单元格格式,

当我尝试在WinXP 32位和64位上读取此单元时,Windows Vista使用Apache poi-3.8-20120326.jar

  

int cellType = cell.getCellType();

我得到了预期的类型String,

当我在

上测试时

Windows Server 2008 RV2 64位 CentOS 64位

我得到的单元格类型是数字,并且我的后续调用对于以上两个操作系统中的后续单元格内容返回true非常奇怪

  

DateUtil.isCellDateFormatted(小区)

细胞含量

  

8500 STOCKDALE AVE BLK

似乎问题是由于8500和StockDALE之间的空间, 如果我删除空间,它在服务器oss和单元格类型上都能很好地生成String。

是否有编码问题?

XLSx格式的工作表和我正在使用XSSF Api,api给我表单类型

  

应用/ vnd.openxmlformats-officedocument.spreadsheetml.sheet

我不知道这是一个问题,所有服务器oss都没有安装Microsoft Office,但它在xp和vista上运行。

我正在完成Stacktrace

DEBUG Sentance

  

DEBUG属性:situsAdd值:8500 STOCKDALE AVE BLK验证器:   com.vs.framework.handler.StringHandler属性类型String

com.vs.framework.handler.StringHandler property type String
com.vs.framework.exception.ValidationException: Invalid object type for numeric property.
    at com.vs.framework.handler.StringHandler.validateProperty(StringHandler.java:17)
    at com.tad.app.handler.CSVCellHandlerImpl.validateCell(CSVCellHandlerImpl.java:233)
    at com.tad.app.handler.CSVCellHandlerImpl.parseCell(CSVCellHandlerImpl.java:114)
    at com.tad.app.importer.PropertyCSVImporterImpl.processCSVSheet(PropertyCSVImporterImpl.java:628)
    at com.tad.app.importer.PropertyCSVImporterImpl.doImport(PropertyCSVImporterImpl.java:132)
    at com.tad.app.presentation.action.ImportCsvPropertyAction.execute(ImportCsvPropertyAction.java:150)
    at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
    at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
    at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    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:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

Excel Sheet Forat

0 个答案:

没有答案