ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Scott Jackson (JIRA)" <j...@apache.org>
Subject [jira] Created: (ODE-226) If the <package> or <zip> nodes are not present in the <deploy> a null pointer exception can occur
Date Tue, 15 Jan 2008 20:37:37 GMT
If the <package> or <zip> nodes are not present in the <deploy> a null pointer
exception can occur

                 Key: ODE-226
                 URL: https://issues.apache.org/jira/browse/ODE-226
             Project: ODE
          Issue Type: Bug
          Components: Management
    Affects Versions: 1.1
            Reporter: Douglas Scott Jackson
            Priority: Minor

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.

<dapi:deploy xmlns:dapi="http://www.apache.org/ode/deployapi">

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
+++ 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
                     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")
                         throw new OdeFault("Your message should contain a part named 'package'
 a zip element");

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message