Cannot construct instance of `com.jty.entities.Dept` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)


使用RestTemplate对象访问请求出错

@GetMapping(value = "/consumer/dept/get/{id}")
    public Dept get(@PathVariable Long id){
        return restTemplate.getForObject(REST_URL_PREFIX+"/dept/get/"+id,Dept.class);
    }

Cannot construct instance of com.jty.entities.Dept (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

原因是缺少构造函数、或者定义了有参构造函数、没定义无参构造函数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM