Failed to start Camel 1.5.0

I am trying to run the Camel "camel-example-spring-jms" example (also at http://activemq.apache.org/camel/tutorial-jmsremoting.html ), However, when I try to start Camel using the org.apache class. camel.spring.Main, I get the error

"Configuration issue: Unable to find Spring namespaceHandler for XML Schema namespace [ http://activemq.apache.org/schema/core] "

[Note: I can run the example just fine when I use the Maven command "mvn exec: java -PCamelServer"]

Can someone please help me understand what might be causing this. A potential permission hint won't hurt :)

++++++ Error Stack +++++

Dec 4, 2008 12:45:01 PM org.apache.camel.util.MainSupport doStart
INFO: Apache Camel 1.5.0 starting
Dec 4, 2008 12:45:01 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ac3c08: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1ac3c08]; startup date [Thu Dec 04 12:45:01 EST 2008]; root of context hierarchy
Dec 4, 2008 12:45:01 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml]
Dec 4, 2008 12:45:02 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml]
Dec 4, 2008 12:45:03 PM org.apache.camel.util.MainSupport run
SEVERE: Failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [camel-server.xml]
Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://activemq.apache.org/schema/core]
Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml]

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [camel-server.xml]
Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server-aop.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://activemq.apache.org/schema/core]
Offending resource: file [C:\dev\camel-example-spring-jms\bin\META-INF\spring\camel-server.xml]

        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:201)
        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:92)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
        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.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
        at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
        at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:189)
        at org.apache.camel.spring.Main.doStart(Main.java:152)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47)
        at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
        at org.apache.camel.util.MainSupport.run(MainSupport.java:310)
        at org.apache.camel.spring.Main.main(Main.java:72)

      

++++++

0


source to share


5 answers


So it works fine under maven control - but not if you run it like? In your IDE or something like that?

If you are using eclipse / intellij you can create an IDE project for maven project using maven.

mvn eclipse:eclipse

      

or



mvn idea:idea

      

If you are writing any shell script or running it from the command line, then most likely you are missing some jars; you will need spring + jaxb + commons-logging + camel-core, camel-spring and camel-jms.

To get an exact list of dependencies in maven-type

mvn dependency:tree

      

+1


source


This particular exception is thrown when the camel-jms.jar library is not in your classpath. As mentioned by James, make sure this library is listed correctly in your classpath at startup.



0


source


I had a similar problem when using camel (although it was camel 1.3). In my case, the error was:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://activemq.apache.org/camel/schema/spring]

      

I was able to fix this by changing my jdk version. I was using jdk 1.5, I updated to 1.6 and solved my problem. Hope this helps.

Monica

0


source


What version of JDK1.5 are you using? Are you using a different JDK on the Eclipse or Command line?

There may be a problem with the wrong JAXB version. Must be JAXB 2.1 or newer.

0


source


I had the same problem both inside Eclipse and with external tools (Maven). As James and Pete pointed out, by adding camel-jms.jar to the classpath I solved my problem. It looks like camel and camel-jms are the main required dependencies:

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-core</artifactId>
  <version>1.6.0</version>
  <scope>compile</scope>
</dependency>

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-jms</artifactId>
  <version>1.6.0</version>
  <scope>runtime</scope>
</dependency>

      

0


source







All Articles