JiBX
  1. JiBX
  2. JIBX-378

A more informative error message if don't pass a value for required field

    Details

    • Type: Wish Wish
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: JiBX 1.2.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows XP
      Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
    • Number of attachments :
      1

      Description

      If don't pass a value for required field than get the following non-informative message about error:

      java.lang.NullPointerException
      at com.company.gateway.services.document.pojo.ChangeStatusParams.JiBX_binding_marshal_1_0(ChangeStatusParams.java)
      at com.company.gateway.services.document.pojo.JiBX_bindingChangeStatusParams_access.marshal()
      at org.apache.axis2.jibx.JiBXDataSource.marshal(JiBXDataSource.java:194)
      ...

      I don't pass a value for required field "status":
      ChangeStatusParams changeStatusParams = new ChangeStatusParams();
      changeStatusParams.setDoc_id(2340909);
      stub.changeStatus(changeStatusParams);

      The part of decompiled function from ChangeStatusParams.class:

      public static void JiBX_binding_marshal_1_0(ChangeStatusParams arg1, MarshallingContext arg2)
      throws JiBXException

      { arg2.pushObject(arg1); arg2.element(3, "doc_id", arg1.doc_id.toString()).element(3, "status", arg1.status.toString()); ... }

      I think that cause of error in arg1.status.toString(), because arg1.status=null

        Activity

        Hide
        Dennis Sosnoski added a comment -

        This is unfortunately a common issue. It's too messy to try to fix it in the current code base, but I'll add an option to handle it directly in 2.0.

        Show
        Dennis Sosnoski added a comment - This is unfortunately a common issue. It's too messy to try to fix it in the current code base, but I'll add an option to handle it directly in 2.0.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Assignee Dennis Sosnoski [ dsosnoski ]

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Alexander Osadchy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: