simple-spring-memcached icon indicating copy to clipboard operation
simple-spring-memcached copied to clipboard

IllegalStateException: Cannot build, 'init()' not yet called

Open NaldoRay opened this issue 8 months ago • 0 comments

When using serialization type JSON, JsonTranscoder throws IllegalStateException with reason "init() is not yet called".

SSM 4.1.3 jackson-databind 2.13.5

It seems current latest implementation is not compatible with jackson version 2.10 (and later), not without providing your own ObjectMapper.

java.lang.IllegalStateException: Cannot build, 'init()' not yet called
	at com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.idResolver(StdTypeResolverBuilder.java:303)
	at com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.buildTypeSerializer(StdTypeResolverBuilder.java:112)
	at com.fasterxml.jackson.databind.ObjectMapper$DefaultTypeResolverBuilder.buildTypeSerializer(ObjectMapper.java:312)
	at com.fasterxml.jackson.databind.ser.BasicSerializerFactory.createTypeSerializer(BasicSerializerFactory.java:325)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findPropertyTypeSerializer(BeanSerializerFactory.java:317)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._constructWriter(BeanSerializerFactory.java:878)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanProperties(BeanSerializerFactory.java:630)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanOrAddOnSerializer(BeanSerializerFactory.java:401)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanOrAddOnSerializer(BeanSerializerFactory.java:294)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:239)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:173)
	at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1495)
	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1443)
	at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:544)
	at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:822)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:308)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4568)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3780)
	at com.google.code.ssm.transcoders.JsonTranscoder.encode(JsonTranscoder.java:95)
        .....

NaldoRay avatar Jun 24 '24 13:06 NaldoRay