我收到了第三方的回复,如下所示
[
{
"url": "https://abc/10",
"created": "2021-02-26 10:45:14",
"status": "approved",
"ref": "12452",
"brand": "edr",
"reason": "jkjkj"
},
{
"url": "https://bvc/20",
"created": "2021-02-26 10:43:18",
"status": "rejected",
"ref": "14562",
"brand": "yghj",
"reason": "asd",
}
]
我们有课。
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetDetails {
private List<Detail> details = new ArrayList<>();
// getters, setters and toString()
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Detail {
@JsonProperty(value = "url")
private String url;
@JsonProperty(value = "created")
private Instant created;
@JsonProperty(value = "status")
private String status;
@JsonProperty(value = "ref")
private String ref;
@JsonProperty(value = "brand")
private String brand;
@JsonProperty(value = "reason")
private String reason;
//Getters, Setters and toString()
}
但是当我们转换时,我们会低于误差
错误com.openbet.commons.sdk.common.util.请求SenderImpl-在HTTP交换过程中意外的异常:org.springframework.http.converter.HttpMessageNotReadableExctive:JSON解析错误:无法反序列化com.document.Get细节
的实例START_ARRAY令牌;嵌套异常是com.fasterxml.jackson.databind.exc.不匹配的输入异常:无法反序列化com.document.Get细节
的实例START_ARRAY令牌
有人能告诉我我在这里做错了什么吗?
public ResponseEntity<?> getDetails(@RequestBody List<Detail> details){}
方法签名示例。
json中没有详细信息属性
您正在尝试转换下面的示例,因此无法转换
{
details : [
{
"url": "https://abc/10",
"created": "2021-02-26 10:45:14",
"status": "approved",
"ref": "12452",
"brand": "edr",
"reason": "jkjkj"
},
{
"url": "https://bvc/20",
"created": "2021-02-26 10:43:18",
"status": "rejected",
"ref": "14562",
"brand": "yghj",
"reason": "asd",
}
]
}
我试图用Spring DI创建一个简单的HelloWorld应用程序。我创建了一个Java项目并导入了一些教程类,其中一个很简单: 然而,我得到了以下错误:。我正在使用Eclipse Spring Tool Suite 3.7.2,当我单击“修复项目设置”时,我认为通过使用这个Eclipse版本,它会为我添加这些依赖项。我在这里做错了什么?即使在STS中,我也需要手动添加这些依赖项吗?如果是,正确
我有一个控制器类,其中有几个方法,其中一个是应该接受POST请求的方法。 当我试图发送一个POST请求时,我得到一个错误,说: POST请求的ContentType是应用程序/x-ww-form-urlencoded; charset=UTF-8。表单数据为: 属性包含“%”。如果删除“%”,程序将运行良好,但当正文包含“%s”时,程序将无法正常运行。
通用方法 (以下)管制员工作正常 另一个跟上面一样的控制器,但给出了一个例外 例外是 例外组织。springframework。刀。InvalidDataAccessApiUsageException:对象引用未保存的临时实例-在刷新之前保存临时实例:com。软的企业资源计划赞成的意见。模型ProPurchaseOrderModel;嵌套的异常是org。冬眠TransientObjectExcep
我在Spring的申请中做了联系表格。我有一个问题: 字段名称上的对象接触中的字段错误:拒绝的值[null];代码[NotBlank.contact.name, NotBlank.name, NotBlank.java.lang.String, NotBlank];参数[org.springframework.context.support.DefaultMessageSourceResolabl
项目xmlns="http://maven.apache.org/POM/4.0.0"xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:模式位置="http://maven.apache.org/POM/4.0.0https://maven.apache.org/xsd/maven-4.0.0.xsd" 在此处输入图像描述
我正在将WebLogic Server 11g(10.3.6.0)升级到12c(12.2.1.3.0)。 我在12c服务器上没有问题地安装了war文件。然后,我尝试启动模块。由于缺少特定的类文件,我得到了错误。似乎该类文件属于“spring-aop-2.5.2.jar.” 当我在WebLogic Server 11g环境中部署相同的war文件时,我没有发现任何问题。我确保war文件中存在“spri