【问题标题】:Spring Data Cassandra UDTSpring Data Cassandra UDT
【发布时间】:2018-08-23 14:48:22
【问题描述】:

春季版:4.3.14 Spring Data cassandra 版本:1.5.10

嗨, 我正在使用 Spring Data Cassandra,并且我有以下域对象

@table
Public class Ticket {
   String tickernum;
   String ticketName;
   List<Subscriber> subscriber;

}


@UserDefinedType()
public class subscriber {
  String imsi;
  String msisdn;
  String name;
}

在我的 cassandra 数据库中,我将订阅者定义为 UDT(用户定义类型)。

我正在尝试使用 Ticket 有效负载发出发布请求以“创建票证”

但是,我收到以下错误:

12:15:21,259  WARN DefaultHandlerExceptionResolver:384 - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `com.datastax.driver.core.UDTValue` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.datastax.driver.core.UDTValue` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

有谁知道如何解决这个问题?

【问题讨论】:

  • 你试过添加空构造函数吗?

标签: spring cassandra user-defined-types


【解决方案1】:

为订阅者 UDT 尝试@UserDefinedType(不带括号)

【讨论】:

    猜你喜欢
    • 2016-04-17
    • 2015-08-03
    • 2018-05-06
    • 2020-10-31
    • 2020-02-19
    • 1970-01-01
    • 1970-01-01
    • 2015-01-04
    • 2019-02-22
    相关资源
    最近更新 更多