java日志空指针怎么定位问题
示例报错:
java.lang.NullPointerException: null at com.ipharmacare.sf.task.service.MatchAuditPlanService.getThisRecipeMsgList(MatchAuditPlanService.java:948) ~[ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.task.service.MatchAuditPlanService.isMzTaskMatched(MatchAuditPlanService.java:115) ~[ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.task.service.MatchAuditPlanService.isTaskMatchAuditPlan(MatchAuditPlanService.java:86) ~[ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.task.service.PharmacistWorkingService.taskBaseAuditPlanMatch(PharmacistWorkingService.java:60) ~[ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.task.service.DistributedTaskService.add(DistributedTaskService.java:107) ~[ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.AuditMainService.submitDistributedTask(AuditMainService.java:753) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.AuditMainService.optMain(AuditMainService.java:311) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.AuditMainService.mainProcess(AuditMainService.java:135) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.filter.HisDataNodeChain.doFilter(HisDataNodeChain.java:26) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.filter.common.HisDataCommonHandler.doFilter(HisDataCommonHandler.java:281) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.filter.HisDataNodeChain.doFilter(HisDataNodeChain.java:28) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.filter.common.XmlValidateHandler.doFilter(XmlValidateHandler.java:74) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.main.service.filter.HisDataNodeChain.doFilter(HisDataNodeChain.java:28) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at com.ipharmacare.sf.thread.RunSfTask.run(RunSfTask.java:39) [ipharmacare-distributed-sf-as-3.2.190523.RELEASE.jar:3.2.190523.RELEASE] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
对于日志中的报错信息,在java中抛异常是从内往外,因此只需要重点关注第一行报错信息,下面的报错都是由于一层层传递调用该方法导致。查看报错的函数源码再定位问题:
踩坑是成长最快的方式