camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Unable to connect to mongodb using camel
Date Thu, 21 Feb 2013 13:35:03 GMT
Hi,

How did you create the CamelContext?
I didn't find the camelContext related definition in the camel-context.xml.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, February 21, 2013 at 8:48 PM, lokeshru wrote:

> In my camel RouteConfig.java I am not able to connect to mongo database. I
> get the following exception : Caused by:
> org.apache.camel.NoSuchBeanException: No bean could be found in the registry
> for: myDb of type: com.mongodb.Mongo at
> org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:130)
> at
> org.apache.camel.component.mongodb.MongoDbComponent.createEndpoint(MongoDbComponent.java:43)
> at
> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:91)
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461)
> ... 42 more
>  
> RouteConfig.java from("jms:queue:Test").bean(new
> SomeBean()).to("mongodb:mydb=flights&collection=tickets&operation=insert");
>  
> camel-context.xml  
>  
> <bean id="mongoTemplate"
> class="org.springframework.data.mongodb.core.MongoTemplate">
> <constructor-arg ref="mongoDbFactory"/>  
> </bean>
> <bean id ="mongoDbFactory"
> class="org.springframework.data.mongodb.core.SimpleMongoDbFactory">
> <constructor-arg ref="mongo"/>
> <constructor-arg name="databaseName" value="db" type="String"/>
> </bean>
> <bean id="myDb" class="com.mongodb.Mongo">
> <constructor-arg name="host" value="127.0.0.1" type="String"/>
> <constructor-arg name="port" value="27017" type="int"/>
> </bean>
>  
> Any help is appreciated
>  
> thanks Lokesh
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Unable-to-connect-to-mongodb-using-camel-tp5727950.html
> Sent from the Camel Development mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message