With BPEL comes XML and with XML comes XPaths... This particular error plagues anyone whom uses xpath in the database with any XML doc. It usually happens when you xpath to a node and its null or does not exist. With that "discovery" of a lost or missing node the code bails and pops up that nice error.
With this challenge, I needed to parse some error messages I received from a web service. Getting to the XML block embedded in a CDATA section is a whole other topic, but when I did get to the error block, I had to XPath into it to get my errors. One of my nodes was not consistently there, so the ORA-30625 kept popping up. A solution is as follows.
Use .existsnode in a if condition:
l_error_block.existsnode('/get:getDocumentFault/get:summary/text()', c_req_namespaces) = 1 then
p_error_message := l_error_block.extract('/get:getDocumentFault/get:summary/text()', c_req_namespaces).getClobVal();
This will check to see if the node exists, and if it does grabs the value, if not it continues on errorless. It works but seems to be a bit much so i'd love to hear any other solutions that might be out there.
XMLTable also works to prevent this, but isnt always needed and might be overkill.