Java Jackson枚举反序列化。springrest模板

Java Jackson枚举反序列化。springrest模板,java,json,spring,enums,jackson,Java,Json,Spring,Enums,Jackson,我将枚举类型和变量添加到我的一个类中。 编写使用该类的spring引导测试 添加枚举后,jacksonapper无法转换类(对于restemplatePOST请求) 以下是错误: 2016-11-17 11:36:11.571 WARN 10000 --- [o-auto-1-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.conve

我将枚举类型和变量添加到我的一个类中。 编写使用该类的spring引导测试

添加枚举后,
jacksonapper
无法转换类(对于
restemplate
POST请求)

以下是错误:

2016-11-17 11:36:11.571  WARN 10000 --- [o-auto-1-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of com.springapp.models.common.Condo: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: java.io.PushbackInputStream@6393fabb; line: 1, column: 2]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.springapp.models.common.Condo: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: java.io.PushbackInputStream@6393fabb; line: 1, column: 2]
2016-11-17 11:36:11.639  INFO 10000 --- [           main] c.s.controllers.api.CondoControllerTest  : status: 400
2016-11-17 11:36:11.639  INFO 10000 --- [           main] c.s.controllers.api.CondoControllerTest  : message: Could not read document: Can not construct instance of com.springapp.models.common.Condo: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: java.io.PushbackInputStream@6393fabb; line: 1, column: 2]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.springapp.models.common.Condo: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: java.io.PushbackInputStream@6393fabb; line: 1, column: 2]
类:

public class Condo {

   **irrelevant fields**

    public Condo(LocationType locationType) {
        this.locationType = locationType;
    }

    public enum LocationType {
        CONDO("condo"), MALL("mall"), STATION("station");

        private String value;

        private LocationType(String value) {
            this.value = value;
        }

        public String stringValue() {
            return this.value;
        }
    }

    public LocationType getLocationType() {
        return locationType;
    }

    LocationType locationType; 
    ** getters/setters**
}
我还尝试使用
@JsonCreator、@jsonValue
,因为它指向其他一些SO线程。没有帮助

请求:

Condo condo = new Condo(Condo.LocationType.CONDO);
** setting fields for condo object ** 

//CREATE
ResponseEntity<JsonResponse> responseEntity = restTemplate.postForEntity(controllerPath+"/add_active", condo, JsonResponse.class);
Condo-Condo=新公寓(Condo.LocationType.Condo);
**公寓对象的设置字段**
//创造
ResponseEntity ResponseEntity=restemplate.postForEntity(controllerPath+“/add_active”,condo,JsonResponse.class);

如果没有
Condo
作为输入参数,请检查控制器代码。从日志上看似乎是这样。Jackson无法反序列化
Condo
的HTTP表示,因为它没有默认构造函数。

mark==>public static enum LocationType{..}并为“Condo”添加默认构造函数,什么是JsonResponse?问题似乎更可能是由响应的反序列化引起的:“无法构造com.springapp.models.common.Condo的实例”,而不是在发送请求时。