Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

xlogger
I have deployed a simple Camel route using Spring DSL, packaged as bundle jar and deploy it into "deploy" folder with a feature.xml packaged in kar file.

However, the Karaf log shows exception "Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]
Offending resource: URL [bundle://250.0:0/META-INF/spring/CamelContext.xml]"

2015-09-24 15:50:14,950 | ERROR | ExtenderThread-1 | ContextLoaderListener            | 278 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBu
ndleXmlApplicationContext(bundle=camel-b2b-karaf, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apa
che.org/schema/spring]
Offending resource: URL [bundle://250.0:0/META-INF/spring/CamelContext.xml]

        at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[272:org.springframework.beans:3.1.4.RELEASE]
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[272:org.springframework.beans:3.1.4.RELEASE]
        at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)[272:org.springframework.beans:3.1.4.RELEASE]
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316)[272:org.springframework.beans:3.1.4.RELEASE]
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1420)[272:org.springframework.beans:3.1.4.RELEASE
]


I checked with feature:list, and camel related features like camel-core and camel-spring have been installed and started...
karaf@root()> feature:list |grep camel
xml-specs-api                           | 2.2.0            |          | Started     | camel-2.15.2                    |
camel                                   | 2.15.2           |          | Started     | camel-2.15.2                    |
camel-core                              | 2.15.2           |          | Started     | camel-2.15.2                    |
camel-catalog                           | 2.15.2           |          | Uninstalled | camel-2.15.2                    |
camel-spring                            | 2.15.2           |          | Started     | camel-2.15.2                    |
camel-blueprint                         | 2.15.2           |          | Started     | camel-2.15.2                    |
camel-ahc                               | 2.15.2           |          | Uninstalled | camel-2.15.2                    |
camel-ahc-ws                            | 2.15.2           |          | Uninstalled | camel-2.15.2                    |


Any other possible issues that I might be missed?



Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

xlogger
Finally able to dig out the issue after some tries... it is because of below entry in feature.xml:
<feature version="4.1.7.RELEASE_1">spring-jms</feature>

The issue is fixed after changing the version to 4.2.0.RELEASE_1

But it's really strange to me that an issue on particular spring-jms feature version would introduce such XSD exception...
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

cschneider
One very important thing is that you must avoid to mix different spring
versions at runtime.

Christian

On 24.09.2015 15:16, xlogger wrote:

> Finally able to dig out the issue after some tries... it is because of below
> entry in feature.xml:
> <feature version="4.1.7.RELEASE_1">spring-jms</feature>
>
> The issue is fixed after changing the version to 4.2.0.RELEASE_1
>
> But it's really strange to me that an issue on particular spring-jms feature
> version would introduce such XSD exception...
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-1-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-namespace-http-camel-apache-org--tp4042748p4042752.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

xlogger
Hi Christian,

I tried to test with a simple Camel project (only a timer and then log) and included 2 entries to feature.xml only

        <feature version="2.15.2">camel-core</feature>
        <feature version="2.15.2">camel-spring</feature>

After I deploy my application and perform feature:list |grep spring, I found that the feature spring/3.2.14.RELEASE_1 was started. I tried to add one more entry like  <feature version="4.2.0.RELEASE_1">spring</feature> to feature.xml and redeploy, and both 3.2 and 4.2 spring versions are started...

Is it possible to enforce camel-spring feature to start with spring 4.2 instead?
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.0.1 - Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]

cschneider
If you take a look at the camel-spring feature in detail:
<feature name="camel-spring" version="2.15.2" resolver="(obr)"
start-level="50">
<bundle
dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
<feature version="[3.2,4)">spring</feature>
<feature version="[1.2,2)">spring-dm</feature>
<feature version="[3.2,4)">spring-tx</feature>
<feature
version="2.15.2">camel-core</feature><bundle>mvn:org.apache.camel/camel-spring/2.15.2</bundle>
</feature>

It limits the spring dependency to <=4. So you have to use a spring 3.x
for camel.

Christian

Am 25.09.2015 um 02:47 schrieb xlogger:

> Hi Christian,
>
> I tried to test with a simple Camel project (only a timer and then log) and
> included 2 entries to feature.xml only
>
>          <feature version="2.15.2">camel-core</feature>
>          <feature version="2.15.2">camel-spring</feature>
>
> After I deploy my application and perform feature:list |grep spring, I found
> that the feature spring/3.2.14.RELEASE_1 was started. I tried to add one
> more entry like  <feature version="4.2.0.RELEASE_1">spring</feature> to
> feature.xml and redeploy, and both 3.2 and 4.2 spring versions are
> started...
>
> Is it possible to enforce camel-spring feature to start with spring 4.2
> instead?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-1-Unable-to-locate-Spring-NamespaceHandler-for-XML-schema-namespace-http-camel-apache-org--tp4042748p4042754.html
> Sent from the Karaf - User mailing list archive at Nabble.com.