[jira] [Assigned] (AXIS2-5943) GSON, MessageContext.isFault() NPE because getEnvelope() returns null

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Assigned] (AXIS2-5943) GSON, MessageContext.isFault() NPE because getEnvelope() returns null

Adam Fordham (Jira)

     [ https://issues.apache.org/jira/browse/AXIS2-5943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Lazarski reassigned AXIS2-5943:
--------------------------------------

    Assignee: Robert Lazarski

> GSON, MessageContext.isFault() NPE because getEnvelope() returns null
> ---------------------------------------------------------------------
>
>                 Key: AXIS2-5943
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5943
>             Project: Axis2
>          Issue Type: Bug
>            Reporter: Robert Lazarski
>            Assignee: Robert Lazarski
>            Priority: Major
>
> As discussed on the user list, after a GSON service completes, this code in MessageContext throws an NPE:
> public boolean isFault() {
>         return getEnvelope().hasFault();
> }
> The code I compiled myself and is running on my production systems is as follows, [~veithen] do you have a suggestion on a better fix? 
> public boolean isFault() {
>         if (getEnvelope() == null) {
>             log.warn(getLogIDString() + ": ****WARNING**** " + myClassName +
>                     " , found null envelope, returning false");
>             return false;
>         }
>         return getEnvelope().hasFault();
> }
>  
> See user list discussion:
>  
> http://mail-archives.apache.org/mod_mbox/axis-java-user/201808.mbox/%3CCABpPLBVTwAa54j1rnjvhrkDtrEEqq9FWZuh-aK-xnr782pmHNw@...%3E
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]