You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bruno Borges <br...@gmail.com> on 2012/06/21 19:08:25 UTC

Can't find xsd schema under camel-spring JAR

I'm trying to load a Spring/Camel context on JBoss 7.1.1, but using a
module to have all JARs defined in one place (like a shared library).

So I've put everything my project needs under
$jboss.home/modules/com/mycompany/main/

What is happening is that, to have Spring to work, I had to add a
jboss-deployment-structure.xml on my JAR:

*META-INF/jboss-deployment-structure.xml*
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<module name="com.bemobi.infosender">
<imports>
<include path="META-INF/**" />
<include path="*.xsd" />
<include path="**/*.xsd" />
<include path="META-INF/spring.*" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>

This is working as the Spring context is starting. But when it tries to
load the <camel:context>, *it fails*, saying it could not find the Spring
NamespaceHandler for XML

*Offending resource: class path resource [META-INF/applicationContext.xml];
nested exception is
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://camel.apache.org/schema/spring] *

My module.xml is similar to:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mycompany">
    <resources>
        <!-- MyCompany dependencies -->
        <resource-root path="mycompany-core-2.0.0-SNAPSHOT.jar" />
        <resource-root path="mycompany-commons-2.0.0-SNAPSHOT.jar" />
        <resource-root path="mycompany-persistence-2.0.0-SNAPSHOT.jar" />

        <!-- =========================== -->
        <!-- Infrastructure dependencies -->
        <!-- =========================== -->
        ... some activemq dependencies
        <resource-root path="camel-core-2.9.2.jar"/>
        <resource-root path="camel-jms-2.9.2.jar"/>
        <resource-root path="camel-jpa-2.9.2.jar"/>
        <resource-root path="camel-quartz-2.9.2.jar"/>
*        <resource-root path="camel-spring-2.9.2.jar"/>*
        .. several other dependencies
        <resource-root path="spring-aop-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-asm-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-beans-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-context-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-context-support-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-core-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-expression-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-jdbc-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-jms-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-orm-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-oxm-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-tx-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-web-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-webmvc-3.1.1.RELEASE.jar"/>
        <resource-root path="spring-ws-core-2.1.0.RELEASE.jar"/>
        <resource-root path="spring-xml-2.1.0.RELEASE.jar"/>
        ... other dependencies
    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="javax.jms.api"/>
        <module name="javax.annotation.api"/>
        <module name="org.apache.commons.logging"/>
    </dependencies>
</module>

*Bruno Borges*
(21) 7672-7099
*www.brunoborges.com*