java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)

Spring JIRA | Jaime L. López Carratalá | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    I have a POJO with a java.util.Date attribute in it and when the POJO is being saved I get this error: java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encodeRecursive(JacksonTranslationService.java:93) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encode(JacksonTranslationService.java:60) at org.springframework.data.couchbase.core.CouchbaseTemplate.translateEncode(CouchbaseTemplate.java:84) at org.springframework.data.couchbase.core.CouchbaseTemplate.access$000(CouchbaseTemplate.java:49) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:120) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234) at org.springframework.data.couchbase.core.CouchbaseTemplate.save(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.save(SimpleCouchbaseRepository.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... The problem seems to be that in JacksonTranslationService.encodeRecursive, the Date is detected as a symple type but then in the jackson core the Date object is not supported, is there any way to translate the dates to JSON?

    Spring JIRA | 3 years ago | Jaime L. López Carratalá
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)
  2. 0

    I have a POJO with a java.util.Date attribute in it and when the POJO is being saved I get this error: java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encodeRecursive(JacksonTranslationService.java:93) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encode(JacksonTranslationService.java:60) at org.springframework.data.couchbase.core.CouchbaseTemplate.translateEncode(CouchbaseTemplate.java:84) at org.springframework.data.couchbase.core.CouchbaseTemplate.access$000(CouchbaseTemplate.java:49) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:120) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234) at org.springframework.data.couchbase.core.CouchbaseTemplate.save(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.save(SimpleCouchbaseRepository.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... The problem seems to be that in JacksonTranslationService.encodeRecursive, the Date is detected as a symple type but then in the jackson core the Date object is not supported, is there any way to translate the dates to JSON?

    Spring JIRA | 3 years ago | Jaime L. López Carratalá
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)
  3. 0

    I have a POJO with a java.util.Date attribute in it and when the POJO is being saved I get this error: java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encodeRecursive(JacksonTranslationService.java:93) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encode(JacksonTranslationService.java:60) at org.springframework.data.couchbase.core.CouchbaseTemplate.translateEncode(CouchbaseTemplate.java:84) at org.springframework.data.couchbase.core.CouchbaseTemplate.access$000(CouchbaseTemplate.java:49) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:120) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234) at org.springframework.data.couchbase.core.CouchbaseTemplate.save(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.save(SimpleCouchbaseRepository.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... The problem seems to be that in JacksonTranslationService.encodeRecursive, the Date is detected as a symple type but then in the jackson core the Date object is not supported, is there any way to translate the dates to JSON?

    Spring JIRA | 3 years ago | Jaime L. López Carratalá
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I have a POJO with a java.util.Date attribute in it and when the POJO is being saved I get this error: java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date) at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515) at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encodeRecursive(JacksonTranslationService.java:93) at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encode(JacksonTranslationService.java:60) at org.springframework.data.couchbase.core.CouchbaseTemplate.translateEncode(CouchbaseTemplate.java:84) at org.springframework.data.couchbase.core.CouchbaseTemplate.access$000(CouchbaseTemplate.java:49) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:120) at org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234) at org.springframework.data.couchbase.core.CouchbaseTemplate.save(CouchbaseTemplate.java:117) at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.save(SimpleCouchbaseRepository.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... The problem seems to be that in JacksonTranslationService.encodeRecursive, the Date is detected as a symple type but then in the jackson core the Date object is not supported, is there any way to translate the dates to JSON?

    Spring JIRA | 3 years ago | Jaime L. López Carratalá
    java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)
  6. 0

    开源中国(OSChina.NET)

    oschina.net | 1 year ago
    java.lang.IllegalStateException: Tomcat connector in failed state at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServle tContainer.start(TomcatEmbeddedServletContainer.java:157) at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte xt.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288) at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte xt.finishRefresh(EmbeddedWebApplicationContext.java:141) at org.springframework.context.support.AbstractApplicationContext.refres h(AbstractApplicationContext.java:483) at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte xt.refresh(EmbeddedWebApplicationContext.java:118) at org.springframework.boot.SpringApplication.refresh(SpringApplication. java:686) at org.springframework.boot.SpringApplication.run(SpringApplication.java :320) at org.springframework.boot.SpringApplication.run(SpringApplication.java :957) at org.springframework.boot.SpringApplication.run(SpringApplication.java :946) at com.baidu.rigel.biplatform.tesseract.application.TesseractApplication .main(TesseractApplication.java:63)

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.Date)

      at com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject()
    2. Jackson-core
      GeneratorBase.writeObject
      1. com.fasterxml.jackson.core.base.GeneratorBase._writeSimpleObject(GeneratorBase.java:515)
      2. com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:262)
      2 frames
    3. Spring Data Couchbase
      SimpleCouchbaseRepository.save
      1. org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encodeRecursive(JacksonTranslationService.java:93)
      2. org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.encode(JacksonTranslationService.java:60)
      3. org.springframework.data.couchbase.core.CouchbaseTemplate.translateEncode(CouchbaseTemplate.java:84)
      4. org.springframework.data.couchbase.core.CouchbaseTemplate.access$000(CouchbaseTemplate.java:49)
      5. org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:120)
      6. org.springframework.data.couchbase.core.CouchbaseTemplate$2.doInBucket(CouchbaseTemplate.java:117)
      7. org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234)
      8. org.springframework.data.couchbase.core.CouchbaseTemplate.save(CouchbaseTemplate.java:117)
      9. org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.save(SimpleCouchbaseRepository.java:82)
      9 frames
    4. Java RT
      NativeMethodAccessorImpl.invoke0
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      1 frame