【发布时间】:2020-08-25 13:08:18
【问题描述】:
我试图序列化一个用于发送和接收的类 (DTO) 在流中。我的 DTO 类与流不在同一个模块中。我 收到以下错误
1.使用@CordaSerializable注解,我的DTO类没有被序列化,它正在抛出
java.io.NotSerializableException: Class "class com.e_mobility.dto.dashboard.DashboardDTO" is not on the whitelist or annotated with @CordaSerializable
-
使用如下手动白名单
类 CustomSerializationWhiteList : SerializationWhitelist { 覆盖 val 白名单: List
> = listOf(DTO::class.java) }
我在运行时收到此错误
net.corda.core.serialization.internal.MissingSerializerException: Unable to create an object serializer for type class com.e_mobility.dto.dashboard.DashboardDTO:
Mandatory constructor parameters [arg0, arg1, arg2, arg3, arg4, arg5, arg6] are missing from the readable properties []
Either provide getters or readable fields for [arg0, arg1, arg2, arg3, arg4, arg5, arg6], or provide a custom serializer for this type
请帮我解决这个错误。 (已编辑)
【问题讨论】:
标签: serialization blockchain corda