AnsweredAssumed Answered

XPath-Query 1.0 throws NullpointerException

Question asked by stephan.burkard on Mar 15, 2017
Latest reply on Apr 4, 2017 by Seenu_Mathew

Hi 

Given an XML document without namespaces

<?xml version="1.0" encoding="UTF-8" ?>
<document/>

and I query with XPath 1.0 for the namespace

The XPath assertion fails, the policy immediately aborts and the client gets a NullpointerException:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>Server</faultcode>
            <faultstring>java.lang.NullPointerException</faultstring>
            <faultactor/>
            <detail/>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

 

When I do exactly the same but with XPath 2.0, it works perfectly. 

 

Throwing an Exception and therefore immediately aborting the policy is a bit rude :-)

I guess the NPE is thrown by the underlying Java Library but it should be catched so that only the assertion fails. 

 

PS: Happens like this on Gateway 8.3.01

 

Regards

Stephan

Outcomes