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.