camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PAC Kieffer Guillaume <>
Subject OSGi - CAMEL and Custom Namespace
Date Mon, 07 May 2012 12:34:09 GMT

I am using Camel (2.8.4) XML DSL on ServiceMix 4.4.1 (OSGi environment)
I created a bundle exposing a custom namespace; here is the blueprint file:

<blueprint xmlns="">
    <service id="myXMLNamespaceHandler"
            <entry key="osgi.service.blueprint.namespace" value=""/>
        <bean class="org.apache.xbean.blueprint.context.impl.XBeanNamespaceHandler">
            <argument value=""/>
            <argument value="scs.xsd"/>
            <argument ref="blueprintBundle"/>
            <argument value="META-INF/services/blueprint/xmlns/v1.0.0"/>



included in the file and the XSD files available on the bundle root.
The bundle is started successfully on the environment.

My Route blueprint file contains following declaration of CamelContext:
<camelContext id="scs-ftp-route" trace="true" xmlns=""

One of my route uses this XPath expression: name(/scs:*)='XXXX'
I am getting the following exception while the xpath expression is being evaluated:

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: name(/scs:*)='XXXX'. Reason:
javax.xml.xpath.XPathExpressionException: org.apache.xpath.domapi.XPathStylesheetDOM3Exception:
Prefix must resolve to a namespace: scs

Referring to adding
the xmlns declaration on the CamelContext Element is sufficient.
But in this case, the namespace handler is customized and deployed on an OSGi env. 

Any idea how to solve that issue: 
Using Namespace aware Xpath within Camel with a custom NamespaceHandler started and declared
as an OSGi Service ?

Thanks for your help ,


View raw message