com.fasterxml.jackson.databind.JsonMappingException: No field named 'schema' (through reference chain: com.demonstration.Event["schema"])

GitHub | anandshah123 | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Not able to serialize avro generated object having schema$ object

    GitHub | 1 year ago | anandshah123
    com.fasterxml.jackson.databind.JsonMappingException: No field named 'schema' (through reference chain: com.demonstration.Event["schema"])

    Root Cause Analysis

    1. java.lang.IllegalStateException

      No field named 'schema'

      at com.fasterxml.jackson.dataformat.avro.ser.ObjectWriteContext._reportUnknownField()
    2. Jackson-dataformat-Avro
      AvroGenerator.writeFieldName
      1. com.fasterxml.jackson.dataformat.avro.ser.ObjectWriteContext._reportUnknownField(ObjectWriteContext.java:124)
      2. com.fasterxml.jackson.dataformat.avro.ser.ObjectWriteContext.writeFieldName(ObjectWriteContext.java:67)
      3. com.fasterxml.jackson.dataformat.avro.AvroGenerator.writeFieldName(AvroGenerator.java:283)
      3 frames
    3. Jackson
      ObjectWriter.writeValueAsBytes
      1. com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:670)
      2. com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
      3. com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
      4. com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:130)
      5. com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1428)
      6. com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1129)
      7. com.fasterxml.jackson.databind.ObjectWriter.writeValueAsBytes(ObjectWriter.java:1025)
      7 frames
    4. Jackson-dataformat-Avro
      WriteGeneratedObject.testWriteBidResponse
      1. com.fasterxml.jackson.dataformat.avro.WriteGeneratedObject.testWriteBidResponse(WriteGeneratedObject.java:16)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    6. JUnit
      JUnit38ClassRunner.run
      1. junit.framework.TestCase.runTest(TestCase.java:176)
      2. junit.framework.TestCase.runBare(TestCase.java:141)
      3. junit.framework.TestResult$1.protect(TestResult.java:122)
      4. junit.framework.TestResult.runProtected(TestResult.java:142)
      5. junit.framework.TestResult.run(TestResult.java:125)
      6. junit.framework.TestCase.run(TestCase.java:129)
      7. junit.framework.TestSuite.runTest(TestSuite.java:252)
      8. junit.framework.TestSuite.run(TestSuite.java:247)
      9. org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
      9 frames
    7. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      1 frame
    8. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      5 frames