Sunday, December 18, 2016

BPM: XPath ClassCastException

Recently I faced below Class Casting error, when I tried to invoke a BPEL service from BPM process.

Error 1:
<Dec 11, 2016 8:37:49> <Error> <oracle.fabric.common.xml.xpath> <BEA-000000> <XPath function failed with error:java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement cannot be cast to java.lang.String
oracle.fabric.common.xml.xpath.XPathFunctionException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement cannot be cast to java.lang.String


Error 2:
ORABPEL-11211

DOM Parsing Exception in translator.
DOM parsing exception in inbound XSD translator while parsing InputStream.
Please make sure that the xml data is valid.

at oracle.tip.adapter.jms.inbound.JmsConsumer.translateFromNative(JmsConsumer.java:591)
        at oracle.tip.adapter.jms.inbound.JmsConsumer.sendInboundMessage(JmsConsumer.java:407)
        at oracle.tip.adapter.jms.inbound.JmsConsumer.send(JmsConsumer.java:1185)
        at oracle.tip.adapter.jms.inbound.JmsConsumer.run(JmsConsumer.java:1065)
Caused by: oracle.xml.parser.v2.XMLParseException; lineNumber: 2; columnNumber: 82; Namespace prefix 'xsi' used but not declared.
        at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:323)
        at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:409)
        at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:232)


Cause:
By default, BPM process variable refers to oracle.xml.parser.v2.XMLElement type and you need to convert it to String, before pass on to BPEL service.

Fix:
Surround input from BPM to BPEL process with string() function.

No comments:

Post a Comment

Provide your thoughts !