概述
两个模块间使用Zookeeper进行远程调用,org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
在调用方使用的注解是@Reference
这里引用的是dubbo下的包,因为引成了第一个,所以报错了,改过来就好了
@Controller
@RequestMapping("/user")
public class UserController {
//远程实现的
@Reference
private UserService userService;
@RequestMapping("/showName")
@ResponseBody
public String showName(){
return userService.getName();
}
}