It would be helpful if you post your code and the complete stack trace...
May be Spring didn't found your Spring file?

However, checkout the Camel in Action code and have a look at [1]. This
code sniped works.

[1]
http://code.google.com/p/camelinaction/source/browse/trunk/chapter13/standalone/src/main/java/camelinaction/InventoryMain.java

Best,
Christian

On Sun, Feb 19, 2012 at 10:52 PM, Samruben <[email protected]> wrote:

> Hi
>
> I am also facing the same issue. I have tried you idea. But I am getting
> this error. I have tried with routing with file://test to file://test2, am
> not getting error. only when i use jms
>
> error:
> Exception in thread "main"
> org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
> exception parsing XML document from class path resource [cameltest.xml];
> nested exception is java.lang.NullPointerException
>        at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
>
> my cameltest.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <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
>       http://camel.apache.org/schema/spring
>       http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>   <bean id="jmstest" class="org.apache.camel.component.jms.JmsComponent">
>    <property name="connectionFactory">
>      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>        <property name="brokerURL" value="tcp://localhost:61616" />
>      </bean>
>    </property>
>  </bean>
>
>  <bean id="jmstest2" class="org.apache.camel.component.jms.JmsComponent">
>    <property name="connectionFactory">
>      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>        <property name="brokerURL" value="tcp://localhost:61616" />
>      </bean>
>    </property>
>  </bean>
>
>    <bean id="downloadLogger" class="camel.JmsToFileRoute"/>
>
>
>  <camelContext xmlns="http://camel.apache.org/schema/spring";>
>    <route>
>      <from uri="jmstest:test.queue"/>
>      <process ref="downloadLogger"/>
>      <to uri="jmstest2:test2.queue"/>
>    </route>
>  </camelContext>
>
> </beans>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/routing-inside-xml-file-tp5483745p5497609.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to