TIBCO BusinessEvents engine throws "Unable to Cast" exception with some of XPath functions.

TIBCO BusinessEvents engine throws "Unable to Cast" exception with some of XPath functions.

book

Article ID: KB0087673

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
When trying to extract elements from an incoming payload using the XPath Functions (evalAsString), it fails with the following exception.

- Unable to cast xs:QName('{http://api.telematics.net/v2/model/accounts}SubscriptionCreatedEvent') to xdt:untypedAtomic. Cause: no prefix defined for namespace "http://api.telematics.net/v2/model/accounts"
java.lang.Exception: no prefix defined for namespace "http://api.telematics.net/v2/model/accounts"?

Resolution
=======

The shared resources (XSDs) in this project use invalid schemaLocations for the import statements.


Example:


<xs:import namespace="http://api.telematics.net/v2/model/common" 

schemaLocation="../../../../../../../common/net.telematics.api.mdl.common/src/main/resources/META-INF/schemas/common-entities-v2.xsd"/>

Is used, which is invalid.  It simple should be:

<xs:import namespace"http://api.telemat=ics.net/v2/model/common" 

schemaLocation="./common-entities-v2.xsd"/>

Correct all the XSDs/WSDL included in the project folder.

Issue/Introduction

TIBCO BusinessEvents engine throws "Unable to Cast" exception with some of XPath functions.