ODE
  1. ODE
  2. ODE-226

If the <package> or <zip> nodes are not present in the <deploy> a null pointer exception can occur

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: Management API
    • Labels:
      None

      Description

      I wanted to post a patch to the code, but wasn't sure how to do so. So, I am creating an issue and putting the patch here.

      The issue is if you send an invalid <deploy> element with only one sub element (invalid request) or with 2 sub elements where
      the second does not have a child element you will get a null pointer exception rather than a nice error message. For someone
      without access to code this will not be very helpful.

      i.e.:
      <dapi:deploy xmlns:dapi="http://www.apache.org/ode/deployapi">
      <dapi:name>xxx</dapi:name>
      <dapi:package>uuencoded-zip-file-without-zip-element</dapi:package>
      </dapi:deploy>

      Here is a patch to fix. I have not figured out how to create a war file in order to test, so it is untested:

      Index: axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java
      ===================================================================
      — axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java (revision 611855)
      +++ axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java (working copy)
      @@ -114,8 +114,8 @@
      if (operation.equals("deploy")) {
      OMElement namePart = messageContext.getEnvelope().getBody().getFirstElement().g
      etFirstElement();
      OMElement zipPart = (OMElement) namePart.getNextOMSibling();

      • OMElement zip = zipPart.getFirstElement();
      • if (!zipPart.getQName().getLocalPart().equals("package") ||
        + OMElement zip = zipPart == null ? null : zipPart.getFirstElement();
        + if (zip == null || !zipPart.getQName().getLocalPart().equals("package") ||
        !zip.getQName().getLocalPart().equals("zip"))
        throw new OdeFault("Your message should contain a part named 'package' with
        a zip element");

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Matthieu Riou
            Reporter:
            Douglas Scott Jackson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development