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:

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(
        at oracle.tip.adapter.jms.inbound.JmsConsumer.sendInboundMessage(
        at oracle.tip.adapter.jms.inbound.JmsConsumer.send(
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(
        at oracle.xml.parser.v2.NonValidatingParser.parseDocument(
        at oracle.xml.parser.v2.XMLParser.parse(

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.

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

No comments:

Post a Comment

Provide your thoughts !