无法写入JSON:找不到针对类net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding的序列化程序 [英] Could not write JSON: No serializer found for class net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding

查看:65
本文介绍了无法写入JSON:找不到针对类net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding的序列化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将spring Web服务器实现为cordapp,但是不断出现相同的序列化错误.

i try to implement spring web server to a cordapp , but continuously getting same Serialization error.

{
"timestamp": 1529999846743,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.http.converter.HttpMessageNotWritableException",
"message": "org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->java.util.Collections$SingletonMap[\"state\"]->java.util.Collections$SingletonMap[\"data\"]->java.util.LinkedHashMap[\"exitKeys\"]->java.util.LinkedHashSet[0]->net.i2p.crypto.eddsa.EdDSAPublicKey[\"params\"]->net.i2p.crypto.eddsa.spec.EdDSANamedCurveSpec[\"curve\"]->net.i2p.crypto.eddsa.math.Curve[\"field\"]->net.i2p.crypto.eddsa.math.Field[\"encoding\"])",
"path": "/api/obligation/cash"

}

推荐答案

在@Configuration类中创建一个ObjectMapper,如下所示:

create an ObjectMapper in a @Configuration class like this :

@Configuration
class Plugin {

   @Bean
   fun registerModule(): ObjectMapper {
      return JacksonSupport.createNonRpcMapper()
   }
}

你很好走!

这篇关于无法写入JSON:找不到针对类net.i2p.crypto.eddsa.math.ed25519.Ed25519LittleEndianEncoding的序列化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆