报错:NullPointerException

提问 未结 1 44
隽
VIP1 2018-12-06 23:46:46
悬赏:20积分 收藏
产品:ani 版本:2.1
报错: 错误信息: java.lang.NullPointerException at com.jeeplus.modules.xxh.projectsschooldis.web.ProjectsschooldisController.expertdis(ProjectsschooldisController.java:248) at com.jeeplus.modules.xxh.projectsschooldis.web.ProjectsschooldisController$$FastClassBySpringCGLIB$$db2bf6b0.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:652) at com.jeeplus.modules.xxh.projectsschooldis.web.ProjectsschooldisController$$EnhancerBySpringCGLIB$$ad390733.expertdis() at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 代码如下: public AjaxJson expertdis(String experts,String leader,String ids) { AjaxJson j = new AjaxJson(); String idArray_experts[]=experts.split(","); String idArray[] =ids.split(","); Projectexpert projectexpert=new Projectexpert(); for(String id : idArray){ projectexpert.setId(null); projectexpert.setPId(id); //for(String expert : idArray_experts){ // User user=UserUtils.get(expert); // projectexpert.setUser(user); projectexpertService.save(projectexpert); //} } j.setMsg("批量分配专家成功"); return j; }
回帖
  • 2018-12-07 10:53:19
    projectexpertService为null。 你是不是没有用autowired 注解 注入该变量
    0 回复