Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1620

Classloader Differences When Copying Records Results in ClassCastException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7.7
    • None
    • java
    • None

    Description

      Similar to the situation described in AVRO-1240, a parent classloader contains the avro classes and a separate classloader contains the avro specific record classes. When using the generated

      newBuilder(SpecificRecord other)
      

      or

      newBuilder(SpecificRecord.Builder other)
      

      methods to duplicate records, the generated code will cause an exception similar to this:

      Caused by: java.lang.ClassCastException: org.apache.avro.generic.GenericData$Record cannot be cast to my.specific.Record
      	at my.specific.Record$Builder.<init>(Record.java:149)
      	at my.specific.Record$Builder.<init>(Record.java:121)
      	at my.specific.Record.newBuilder(Record.java:115)
      	... 19 more
      

      Attachments

        1. AVRO-1620.patch
          10 kB
          Doug Cutting
        2. AVRO-1620.patch
          17 kB
          Allan Shoup
        3. AVRO-1620-1.patch
          13 kB
          Ryan Blue

        Activity

          People

            Unassigned Unassigned
            aj987 Allan Shoup
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: