ZmPlanDayAction objPlanDay = new ZmPlanDayAction();
objPlanDay.setDao(dao);
objPlanDay.setServletRequest(req);
objPlanDay.analy(prcsDate, itemId, "01", id, custId, "01", condId, condName,
mayQues, contentId, contentName, measure, content, analy);
运行时,执行到第一行时出现了下面的错误:
Caused by: java.lang.NoClassDefFoundError at com.jc.zm.ZmAlarmAction.analyDo(ZmAlarmAction.java:198)
检查发现,ZmPlanDayAction.class 文件存在,后仔细检查发现,原来这些文件在开始的时候就已经出错了,导致了class文件不能执行下去的情况。
ZmPlanDayAction.java在开头时候的语句错误了。代码如下:
private static Integer dayPlanFlowId = Integer.parseInt(BaseConfig.getValue("dayPlanFlowId"));
private static Integer weekPlanFlowId = Integer.parseInt(BaseConfig.getValue("weekPlanFlowId"));
private static Integer monthPlanFlowId = Integer.parseInt(BaseConfig.getValue("monthPlanFlowId"));
private static Integer planSumFlowId = Integer.parseInt(BaseConfig.getValue("planSumFlowId"));
最后一句代码中的 planSumFlowId 这个在配置文件(baseconfig.properties)中的名称为“sumPlanFlowId”,因为找不到该配置项,导致了class文件一开始就错误了。