You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2018/12/18 23:09:00 UTC

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

    [ https://issues.apache.org/jira/browse/AXIS2-5943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16724546#comment-16724546 ] 

Andreas Veithen commented on AXIS2-5943:
----------------------------------------

I think that the basic assumption that the Axis2 architecture makes is that any payload always has some form of SOAP representation and the envelope should therefore never be null. And in fact {{GsonXMLStreamReader}} appears to define such a representation.

> 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
>            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@mail.gmail.com%3E
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org