13 Replies Latest reply on Jun 27, 2013 8:59 AM by dako ak

    EAP6.1/JBoss7 Snowdrop and Camel

    dako ak Newbie

      Hi all,

       

      Currently I try to start with a camel spring project but I can't bring it to work.

      I have realised a spring jar deployment with Snowdrop 2.0.5 on EAP 6.1 and for now, everything works fine.

      But I can't start a camel route from my spring file. I have created a camel-core and a spring-camel module but I got the error message

      "Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]"

      when my spring jar starts deploying.

       

       

      This are my spring files:

       

      jboss-spring.xml to start the spring application (snowdrop):

       

      <beans xmlns="http://www.springframework.org/schema/beans"

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

       

          <description>BeanFactory=(MyCamelSpring)</description>

       

          <import resource="/spring/camel-route.xml"/>

       

       

      </beans>

       

       

      camel-route.xml:

       

      <beans xmlns="http://www.springframework.org/schema/beans"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"

          xmlns:context="http://www.springframework.org/schema/context"

          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

             http://camel.apache.org/schema/spring classpath:META-INF/spring/camel-spring.xsd

             http://www.springframework.org/schema/context classpath:META-INF/spring/spring-context-3.0.xsd">

       

          <context:load-time-weaver weaver-class="org.jboss.instrument.classloading.JBossLoadTimeWeaver"/>

       

          <import resource="classpath:META-INF/spring/spring-bean.xml" />

       

           <camelContext xmlns="http://camel.apache.org/schema/spring">

              <route>

                  <from uri="timer://myTimer?fixedRate=true&amp;period=5s" />

                  <bean ref="myBean" method="print" />

              </route>

          </camelContext>

       

      </beans>

       

       

       

       

       

      spring-bean.xml

      <beans xmlns="http://www.springframework.org/schema/beans"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

       

          <bean id="myBean" class="de.mycompany.myspringcamel.MyBean">

          </bean>

      </beans>

        • 1. Re: EAP6.1/JBoss7 Snowdrop and Camel
          Tejas Mehta Newbie

          Hello,

           

          Sounds like either there are conflicting jars or you are missing a jar. Could make sure camel-spring.jar is in your deployment.

           

          Tejas M.

          • 2. Re: EAP6.1/JBoss7 Snowdrop and Camel
            dako ak Newbie

            Hi Tejas,

             

            I have included my camel and my camel-spring modules in my META-INF\jboss-deployment-structure.xml

             

            Thats my xml file:

             

            <jboss-deployment-structure>

                <deployment>

                    <dependencies>

                        <module name="org.apache.camel.core" />

                        <module name="org.apache.camel.spring" />

                    </dependencies>

                </deployment>

            </jboss-deployment-structure>

             

            thats my camel module.xml:

             

            <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.core">

             

                <resources>

                    <resource-root path="camel-core-2.10.0.jar"/>

                </resources>

             

                <dependencies>

                    <module name="javax.api"/>

                    <module name="javax.xml.stream.api"/>

                    <module name="org.apache.commons.logging"/>

                    <module name="org.slf4j"/>

                    <module name="org.switchyard.jaxb-impl" services="export" export="true"/>

                </dependencies>

            </module>

             

            thats my camel-spring module.xml:

             

            <module xmlns="urn:jboss:module:1.0" name="org.apache.camel.spring">

             

                <resources>

                    <resource-root path="camel-spring-2.10.0.jar"/>

                </resources>

             

                <dependencies>

                    <module name="org.apache.camel.core"/>

                    <module name="javax.api"/>

                    <module name="org.apache.camel.core"/>

                    <module name="org.apache.commons.logging"/>

                    <module name="javax.jms.api"/>

                    <module name="org.springframework" slot="snowdrop"/>

                    <module name="org.slf4j"/>

                </dependencies>

            </module>

            • 3. Re: EAP6.1/JBoss7 Snowdrop and Camel
              Tejas Mehta Newbie

              Could you try updating META-INF\jboss-deployment-structure.xml:

               

              <jboss-deployment-structure>

                  <deployment>

                      <dependencies>

                          <module name="org.apache.camel.core">

                             <exports>

                                 <include path="META-INF**"/>

                                 <include path="org**"/>

                             </exports>

                             <imports>

                                 <include path="META-INF**"/>

                                 <include path="org**"/>

                             </imports>

                         </module>

                          <module name="org.apache.camel.spring">              

                              <exports>

                                  <include path="META-INF**"/>

                                  <include path="org**"/>

                              </exports>

                              <imports>

                                  <include path="META-INF**"/>

                                  <include path="org**"/>

                              </imports>

                          </module>

                      </dependencies>

                  </deployment>

              </jboss-deployment-structure>


              The reason for the exports/imports is that JBoss generally doesn't export the META-INF directories and the spring xsd's are generally contained in those dirs.

              • 4. Re: EAP6.1/JBoss7 Snowdrop and Camel
                dako ak Newbie

                hi,

                 

                I got the following exceptions:

                 

                17:26:29,181 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.camel.spring.handler.CamelNamespaceHandler in Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)))

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257) [spring-core.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:124) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1333) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:207) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans.jar:3.0.6.RELEASE]

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans.jar:3.0.6.RELEASE]

                    at org.jboss.spring.factory.NamedXmlApplicationContext.loadBeanDefinitions(NamedXmlApplicationContext.java:75) [snowdrop-deployers.jar:2.0.5.Final]

                    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92) [spring-context.jar:3.0.6.RELEASE]

                    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) [spring-context.jar:3.0.6.RELEASE]

                    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) [spring-context.jar:3.0.6.RELEASE]

                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) [spring-context.jar:3.0.6.RELEASE]

                    at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:69) [snowdrop-deployers.jar:2.0.5.Final]

                    at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:59) [snowdrop-deployers.jar:2.0.5.Final]

                    at org.jboss.spring.deployers.as7.SpringBootstrapProcessor.deploy(SpringBootstrapProcessor.java:69) [snowdrop-subsystem-as7.jar:2.0.5.Final]

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_12]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_12]

                    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_12]

                Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerSupport

                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_12]

                    at java.lang.ClassLoader.defineClass(ClassLoader.java:621) [rt.jar:1.6.0_12]

                    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    ... 42 more

                Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.xml.NamespaceHandlerSupport from [Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base))]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [rt.jar:1.6.0_12]

                    ... 46 more

                 

                17:26:29,181 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."MySpringCamel.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."MySpringCamel.jar".INSTALL: JBAS018733: Verarbeitung von Phase INSTALL von deployment "MySpringCamel.jar" fehlgeschlagen

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_12]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_12]

                    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_12]

                Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [/spring/camel-route.xml]

                Offending resource: "/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/jboss-spring.xml"; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [vfs:/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/spring/camel-route.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)))

                    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:218)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)

                    at org.jboss.spring.factory.NamedXmlApplicationContext.loadBeanDefinitions(NamedXmlApplicationContext.java:75)

                    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)

                    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)

                    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)

                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)

                    at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:69)

                    at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:59)

                    at org.jboss.spring.deployers.as7.SpringBootstrapProcessor.deploy(SpringBootstrapProcessor.java:69)

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                    ... 5 more

                Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [vfs:/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/spring/camel-route.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)))

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:207)

                    ... 21 more

                Caused by: org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)))

                    at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:139)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1333)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)

                    ... 26 more

                Caused by: java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base)))

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:427) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:260) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:75) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.Module.loadModuleClass(Module.java:526) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:188) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)

                    at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:124)

                    ... 32 more

                Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerSupport

                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_12]

                    at java.lang.ClassLoader.defineClass(ClassLoader.java:621) [rt.jar:1.6.0_12]

                    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:344) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:422) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    ... 42 more

                Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.xml.NamespaceHandlerSupport from [Module "org.apache.camel.spring:main" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\jboss-eap-6.1\modules,C:\jboss-eap-6.1\modules\system\layers\base))]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:399) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

                    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [rt.jar:1.6.0_12]

                    ... 46 more

                 

                17:26:29,197 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy von Deployment "MySpringCamel.jar" wurde mit folgender Fehlermeldung zurückgesetzt:

                {"JBAS014671: Fehlgeschlagene Dienste" => {"jboss.deployment.unit.\"MySpringCamel.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MySpringCamel.jar\".INSTALL: JBAS018733: Verarbeitung von Phase INSTALL von deployment \"MySpringCamel.jar\" fehlgeschlagen

                    Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [/spring/camel-route.xml]

                Offending resource: \"/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/jboss-spring.xml\"; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [vfs:/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/spring/camel-route.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module \"org.apache.camel.spring:main\" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\\jboss-eap-6.1\\modules,C:\\jboss-eap-6.1\\modules\\system\\layers\\base)))

                    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [vfs:/C:/jboss-eap-6.1/bin/content/MySpringCamel.jar/META-INF/spring/camel-route.xml]; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module \"org.apache.camel.spring:main\" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\\jboss-eap-6.1\\modules,C:\\jboss-eap-6.1\\modules\\system\\layers\\base)))

                    Caused by: org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.camel.spring.handler.CamelNamespaceHandler] for namespace [http://camel.apache.org/schema/spring]: problem with handler class file or dependent class; nested exception is java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module \"org.apache.camel.spring:main\" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\\jboss-eap-6.1\\modules,C:\\jboss-eap-6.1\\modules\\system\\layers\\base)))

                    Caused by: java.lang.LinkageError: Failed to link org/apache/camel/spring/handler/CamelNamespaceHandler (Module \"org.apache.camel.spring:main\" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\\jboss-eap-6.1\\modules,C:\\jboss-eap-6.1\\modules\\system\\layers\\base)))

                    Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerSupport

                    Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.xml.NamespaceHandlerSupport from [Module \"org.apache.camel.spring:main\" from local module loader @1581593 (finder: local module finder @1f06dc3 (roots: C:\\jboss-eap-6.1\\modules,C:\\jboss-eap-6.1\\modules\\system\\layers\\base))]"}}

                • 5. Re: EAP6.1/JBoss7 Snowdrop and Camel
                  Tejas Mehta Newbie

                  In your camel-spring module.xml: I believe there is an error:

                   

                  <module name="org.springframework" slot="snowdrop"/>, should be <module name="org.springframework.spring" slot="snowdrop"/>

                  • 6. Re: EAP6.1/JBoss7 Snowdrop and Camel
                    dako ak Newbie

                    Ok, you are right. I have changed it, now I got this exception:

                     

                    17:42:43,672 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."MySpringCamel.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."MySpringCamel.jar".INSTALL: JBAS018733: Verarbeitung von Phase INSTALL von deployment "MySpringCamel.jar" fehlgeschlagen

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_12]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_12]

                        at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_12]

                    Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.jboss.instrument.classloading.JBossLoadTimeWeaver] for bean with name 'loadTimeWeaver' defined in null; nested exception is java.lang.ClassNotFoundException: org.jboss.instrument.classloading.JBossLoadTimeWeaver from [Module "deployment.MySpringCamel.jar:main" from Service Module Loader]

                        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)

                        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)

                        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1330)

                        at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:896)

                        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)

                        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)

                        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)

                        at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:69)

                        at org.jboss.spring.factory.NamedXmlApplicationContext.<init>(NamedXmlApplicationContext.java:59)

                        at org.jboss.spring.deployers.as7.SpringBootstrapProcessor.deploy(SpringBootstrapProcessor.java:69)

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                        ... 5 more

                    Caused by: java.lang.ClassNotFoundException: org.jboss.instrument.classloading.JBossLoadTimeWeaver from [Module "deployment.MySpringCamel.jar:main" from Service Module Loader]

                        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]

                        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]

                        at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)

                        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)

                        at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1282)

                        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)

                        ... 15 more

                    • 7. Re: EAP6.1/JBoss7 Snowdrop and Camel
                      Tejas Mehta Newbie

                      Could you paste your pom.xml, you might be missing snowdrop-weaving dependency or it could have been scoped as <provided>?

                      • 8. Re: EAP6.1/JBoss7 Snowdrop and Camel
                        dako ak Newbie

                        Thank you for your help. The dependencies are not in scope provided, but I add no classpath entries to my jar. Thats my pom.xml:

                         

                        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

                            <modelVersion>4.0.0</modelVersion>

                         

                            <groupId>de.mycompany.myspringcamel</groupId>

                            <artifactId>myspringcamel</artifactId>

                            <packaging>jar</packaging>

                            <version>1.0</version>

                            <name>MySpringCamel</name>

                         

                            <properties>

                                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                                <camel.version>2.10.0</camel.version>

                                <spring.version>3.0.5.RELEASE</spring.version>

                            </properties>

                         

                            <dependencies>

                         

                                <dependency>

                                    <groupId>org.slf4j</groupId>

                                    <artifactId>slf4j-log4j12</artifactId>

                                    <version>1.5.11</version>

                                </dependency>

                         

                                <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-core</artifactId>

                                    <version>${spring.version}</version>

                                </dependency>

                         

                                <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-context</artifactId>

                                    <version>${spring.version}</version>

                                </dependency>

                         

                                <dependency>

                                    <groupId>org.springframework.security</groupId>

                                    <artifactId>spring-security-config</artifactId>

                                    <version>${spring.version}</version>

                                </dependency>

                         

                                <dependency>

                                    <groupId>org.apache.camel</groupId>

                                    <artifactId>camel-core</artifactId>

                                    <version>${camel.version}</version>

                                </dependency>

                         

                                <dependency>

                                    <groupId>org.apache.camel</groupId>

                                    <artifactId>camel-spring</artifactId>

                                    <version>${camel.version}</version>

                                </dependency>

                         

                            </dependencies>

                         

                            <build>

                                <plugins>

                                    <plugin>

                                        <groupId>org.apache.maven.plugins</groupId>

                                        <artifactId>maven-compiler-plugin</artifactId>

                                        <version>2.3.2</version>

                                        <configuration>

                                            <source>1.6</source>

                                            <target>1.6</target>

                                        </configuration>

                                    </plugin>

                         

                                    <plugin>

                                        <artifactId>maven-clean-plugin</artifactId>

                                        <version>2.2</version>

                                        <executions>

                                            <execution>

                                                <phase>initialize</phase>

                                                <goals>

                                                    <goal>clean</goal>

                                                </goals>

                                            </execution>

                                        </executions>

                                    </plugin>

                         

                                    <plugin>

                                        <artifactId>maven-jar-plugin</artifactId>

                                        <configuration>

                                            <finalName>MySpringCamel</finalName>

                         

                                            <outputDirectory>createdJar</outputDirectory>

                         

                                            <archive>

                                                <addMavenDescriptor>false</addMavenDescriptor>

                                            </archive>

                                        </configuration>

                                    </plugin>

                         

                                    <plugin>

                                        <groupId>org.apache.maven.plugins</groupId>

                                        <artifactId>maven-dependency-plugin</artifactId>

                                        <executions>

                                            <execution>

                                                <id>copy-dependencies</id>

                                                <phase>package</phase>

                                                <goals>

                                                    <goal>copy-dependencies</goal>

                                                </goals>

                                                <configuration>

                                                    <outputDirectory>createdJar/lib</outputDirectory>

                                                    <overWriteReleases>false</overWriteReleases>

                                                    <overWriteSnapshots>true</overWriteSnapshots>

                                                </configuration>

                                            </execution>

                                        </executions>

                                    </plugin>

                         

                                </plugins>

                               

                            </build>

                         

                        </project>

                        • 9. Re: EAP6.1/JBoss7 Snowdrop and Camel
                          Tejas Mehta Newbie

                          No problem, I am happy to help.

                           

                          Well I think you have two options:

                           

                          1. (Recommended option) You could add snowdrop-weaving.jar to your classpath by include the following dependency:

                                    <dependency>

                                      <groupId>org.jboss.snowdrop</groupId>

                                      <artifactId>snowdrop-weaving</artifactId>

                                      <version>2.0.5.Final</version>

                                  </dependency>

                           

                          However, if you don't wish to add jars to your classpath entries then you can try the following:

                          2. Download the snowdrop-weaving jar from: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/snowdrop/snowdrop-weaving/2.0.5.Final/, and add it one of the jboss modules and include it in the module.xml. Preferably in org.jboss.snowdrop or org.apache.camel.spring.

                           

                          Note: for option 1, you need to have you ~/.m2/settings.xml configured to have https://repository.jboss.org/nexus/content/groups/public-jboss as an active repository. See: https://community.jboss.org/wiki/MavenGettingStarted-Users, for more details.

                                  

                           

                           


                          • 10. Re: EAP6.1/JBoss7 Snowdrop and Camel
                            dako ak Newbie

                            I will try it tomorrow at work. But one question before.

                            I'am new to the JBoss 7 module technology and I think that if I work with a jar deployment then I have to declare all library dependencies in my

                            META-INF\jboss-deployment-structure.xml

                             

                            Your recommended option one means that I should add the snowdrop-weaving jar to the classpath by my maven pom.xml. I'am not sure how it works.

                            • 11. Re: EAP6.1/JBoss7 Snowdrop and Camel
                              dako ak Newbie

                              Hi,

                               

                              I have added the "snowdrop-weaving-2.0.5.Final.jar" to the snowdrop module and now it works :-)

                              Many many thanks.

                               

                              Regarding to my last post I'am interested how can I add the snowdrop-waeving jar to my jar deployment without adding it to the snowdrop or camel module.

                               

                              Best regards

                              • 12. Re: EAP6.1/JBoss7 Snowdrop and Camel
                                Tejas Mehta Newbie

                                Hi,

                                 

                                Glad that it is working for you.

                                 

                                As for adding the dependency to the jar, you can do it but I had been thinking in terms of wars (since that is what I generally work with) so option 1 is actually not the recommended option in this case. However, if you are still interested in how to do it: one way is to use the maven-assembly-plugin:

                                 

                                <plugin>
                                   
                                <artifactId>maven-assembly-plugin</artifactId>
                                   
                                <executions>
                                     
                                <execution>
                                       
                                <phase>package</phase>
                                       
                                <goals>
                                         
                                <goal>single</goal>
                                       
                                </goals>
                                     
                                </execution>
                                   
                                </executions>
                                   
                                <configuration>
                                     
                                <descriptorRefs>
                                            
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                                     
                                </descriptorRefs>
                                   
                                </configuration>
                                 
                                </plugin>

                                 

                                This will create a *-jar-with-dependencies file, that way you could include the dependency jars (exploded) in your jar. I am not entirely familiar with deploying jars so I am not sure if there are any issues with doing this.

                                • 13. Re: EAP6.1/JBoss7 Snowdrop and Camel
                                  dako ak Newbie

                                  Hi,

                                   

                                  ok, I have never included jars into jars but it's possible as far as I know. I think too that working with modules is the best way.

                                   

                                  Best regards