Uploaded image for project: 'ProtoStream'
  1. ProtoStream
  2. IPROTO-63

writeObject throws IllegalArgumentException with oneof label

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • DataGrid Sprint #30

      The below schema results in the following exception:

      Schema:

      message EntryVersion {
          oneof version {
              NumericVersion numeric = 1;
              ClusteredVersion clustered = 2;
          }
      //    optional NumericVersion numeric = 1;
      //    optional ClusteredVersion clustered = 2;
      }
      
      message NumericVersion {
          required int64 version = 1;
      }
      
      message ClusteredVersion {
          required int64 version = 1;
          required int32 topology = 2;
      }
      

      Exception:

      java.lang.IllegalArgumentException: Declared field type is not a message or an enum : numeric
      

      It seems this is caused because the type for the field "numeric" is null in the associated FieldDescriptor object that is retrieved in the writeObject impl.

      If the oneof label is replaced with the commented optional fields, the marshallers work as expected.

            [IPROTO-63] writeObject throws IllegalArgumentException with oneof label

            Pedro Ruivo made changes -
            Fix Version/s Original: 5.0.2.Final [ 12425785 ]
            Pedro Ruivo made changes -
            Fix Version/s New: 5.0.2.Final [ 12425785 ]
            Fix Version/s Original: 5.0.1.Final [ 12424458 ]
            Tristan Tarrant made changes -
            Fix Version/s New: 5.0.1.Final [ 12424458 ]
            Fix Version/s Original: 5.0.0.Final [ 12342556 ]
            Tristan Tarrant made changes -
            Workflow Original: GIT Pull Request with Triage workflow [ 12911615 ] New: OJA-WF-BG [ 24889464 ]
            Status Original: Coding In Progress [ 3 ] New: In Progress [ 10018 ]
            Fabio Massimo Ercoli made changes -
            Assignee Original: Adrian Nistor [ anistor ] New: Fabio Massimo Ercoli [ fercoli@redhat.com ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 5.0.0.Final [ 12342556 ]
            Fix Version/s Original: 4.4.0.Beta4 [ 12355538 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Beta4 [ 12355538 ]
            Fix Version/s Original: 4.4.0.Beta3 [ 12354770 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Beta3 [ 12354770 ]
            Fix Version/s Original: 4.4.0.Beta2 [ 12354595 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Beta2 [ 12354595 ]
            Fix Version/s Original: 4.4.0.Beta1 [ 12354260 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Beta1 [ 12354260 ]
            Fix Version/s Original: 4.4.0.Alpha6 [ 12352853 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha6 [ 12352853 ]
            Fix Version/s Original: 4.4.0.Alpha5 [ 12352852 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha5 [ 12352852 ]
            Fix Version/s Original: 4.4.0.Alpha4 [ 12351829 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha4 [ 12351829 ]
            Fix Version/s Original: 4.4.0.Alpha3 [ 12351485 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha3 [ 12351485 ]
            Fix Version/s Original: 4.4.0.Alpha2 [ 12351481 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha2 [ 12351481 ]
            Fix Version/s Original: 4.4.0.Alpha1 [ 12345279 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.4.0.Alpha1 [ 12345279 ]
            Fix Version/s Original: 4.3.3.Final [ 12344594 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.3.Final [ 12344594 ]
            Fix Version/s Original: 4.3.2.Final [ 12343550 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.2.Final [ 12343550 ]
            Fix Version/s Original: 4.3.1.Final [ 12343286 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s Original: 4.3.0.Alpha14 [ 12342982 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.1.Final [ 12343286 ]
            Fix Version/s Original: 4.3.0.Final [ 12337419 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha14 [ 12342982 ]
            Fix Version/s Original: 4.3.0.Alpha13 [ 12342954 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha13 [ 12342954 ]
            Fix Version/s Original: 4.3.0.Alpha12 [ 12342803 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha12 [ 12342803 ]
            Fix Version/s Original: 4.3.0.Alpha11 [ 12342680 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha11 [ 12342680 ]
            Fix Version/s Original: 4.3.0.Alpha10 [ 12342560 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha10 [ 12342560 ]
            Fix Version/s Original: 4.3.0.Alpha9 [ 12342269 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha9 [ 12342269 ]
            Fix Version/s Original: 4.3.0.Alpha8 [ 12342223 ]
            Adrian Nistor (Inactive) made changes -
            Sprint New: DataGrid Sprint #30 [ 8842 ]
            Adrian Nistor (Inactive) made changes -
            Rank New: Ranked lower
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Alpha8 [ 12342223 ]
            Adrian Nistor (Inactive) made changes -
            Fix Version/s New: 4.3.0.Final [ 12337419 ]
            Adrian Nistor (Inactive) made changes -
            Status Original: Open [ 1 ] New: Coding In Progress [ 3 ]
            Adrian Nistor (Inactive) made changes -
            Assignee New: Adrian Nistor [ anistor ]
            Adrian Nistor (Inactive) made changes -
            Status Original: New [ 10016 ] New: Open [ 1 ]
            Ryan Emerson made changes -
            Description Original: The below schema results in the following exception:

            Schema:
            {code:java}
            message EntryVersion {
                oneof version {
                    NumericVersion numeric = 1;
                    ClusteredVersion clustered = 2;
                }
            // optional NumericVersion numeric = 1;
            // optional ClusteredVersion clustered = 2;
            }

            message NumericVersion {
                required int64 version = 1;
            }

            message ClusteredVersion {
                required int64 version = 1;
                required int32 topology = 2;
            }
            {code}

            Exception:

            {code:java}
            java.lang.IllegalArgumentException: Declared field type is not a message or an enum : numeric
            {code}

            It seems this is caused because the type for the field "numeric" is null in the associated FieldDescriptor object that is retrieved in the [writeObject impl|https://github.com/infinispan/protostream/blob/master/core/src/main/java/org/infinispan/protostream/impl/ProtoStreamWriterImpl.java#L452-L470].
            New: The below schema results in the following exception:

            Schema:
            {code:java}
            message EntryVersion {
                oneof version {
                    NumericVersion numeric = 1;
                    ClusteredVersion clustered = 2;
                }
            // optional NumericVersion numeric = 1;
            // optional ClusteredVersion clustered = 2;
            }

            message NumericVersion {
                required int64 version = 1;
            }

            message ClusteredVersion {
                required int64 version = 1;
                required int32 topology = 2;
            }
            {code}

            Exception:

            {code:java}
            java.lang.IllegalArgumentException: Declared field type is not a message or an enum : numeric
            {code}

            It seems this is caused because the type for the field "numeric" is null in the associated FieldDescriptor object that is retrieved in the [writeObject impl|https://github.com/infinispan/protostream/blob/master/core/src/main/java/org/infinispan/protostream/impl/ProtoStreamWriterImpl.java#L452-L470].

            If the oneof label is replaced with the commented optional fields, the marshallers work as expected.
            Ryan Emerson created issue -

              fercoli@redhat.com Fabio Massimo Ercoli
              remerson@redhat.com Ryan Emerson
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Archived: