我不太会java,问一下出现这种情况怎么解决,这是一部分,下面还有很多行,谢啦严重: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at dlraManage.model.ExcelPoi.readXml(ExcelPoi.java:49)
at dlraManage.actions.BathInsertAction.execute(BathInsertAction.java:50)
java.lang.NullPointerException
at dlraManage.model.ExcelPoi.readXml(ExcelPoi.java:49)
at dlraManage.actions.BathInsertAction.execute(BathInsertAction.java:50)
同意1楼将ExcelPoi.java:49行前后的代码贴出来
if(obj==null){
// 处理后 return 或者 new obj
}
Excelpoi 第49行
dlraManage.model.ExcelPoi.readXml(ExcelPoi.java:49)
dlraManage.actions.BathInsertAction.execute(BathInsertAction.java:50)
sFormat.format(
HSSFDateUtil.getJavaDate(row
.getCell(0)
.getNumericCellValue()))
.toString(), sFormat.format(
HSSFDateUtil.getJavaDate(row
.getCell(1)
.getNumericCellValue()))
.toString(), row.getCell(2)
.toString(), row.getCell(3)
.toString(), row.getCell(4)
.toString(), sFormat.format(
HSSFDateUtil.getJavaDate(row
.getCell(5)
.getNumericCellValue()))
.toString(), row.getCell(6)
.toString()));
}
这是这一段代码,应该是获取excel表格的信息吧,.getcell(0)是第49行,这个代码不是我写的,问题在哪呢