Fuse: Exception while using mongodb connector

Posted on

Hi All, I've created sample project to connect to mongodb. while performing osgi:install of bundle, below exception is thrown. Could someone help here.

Error:
Unresolved constraint in bundle org.fusebyexample.mq-fabric.camel-consumer [295]: Unable to resolve 295.0: missing requirement [295.0] osgi.wiring.package; (&(osgi.wiring.package=com.mongodb)(version>=2.12.0)(!(version>=3.0.0)))

camel-context.xml:

<camelContext id="ConsumerContext" xmlns="http://camel.apache.org/schema/spring">
  <route id="ConsumerRoute">
    <from uri="activemq:queue:queue/simple"/>
    <log message="Got Now... ${bean:counter?method=getAndIncrement}. message: ${body}"/>
    <to uri="mongodb:myDb?collection=tickets&amp;operation=save&amp;database=flights"/>
    </route>
</camelContext>
<bean id="myDb" class="com.mongodb.Mongo">
  <constructor-arg index="0" value="localhost"/>
</bean>

POM.XML (Camel part):

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-mongodb</artifactId>
  <version>2.15.1.redhat-620133</version>
</dependency>
<dependency>
  <groupId>org.mongodb</groupId>
  <artifactId>mongo-java-driver</artifactId>
  <version>2.12.4</version>
</dependency>

Manifest (mongo-java-driver):

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.2
Created-By: 1.7.0_51-b13 (Oracle Corporation)
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion: 2
Bundle-Name: MongoDB Java Driver
Bundle-SymbolicName: org.mongodb.mongo-java-driver
Bundle-Version: 2.12.4.RELEASE
Import-Package: javax.management,javax.net,javax.net.ssl,javax.securit
 y.sasl,javax.security.auth.login,javax.security.auth,org.ietf.jgss
Export-Package: com.mongodb;version="2.12.4.RELEASE",com.mongodb.io;ve
 rsion="2.12.4.RELEASE",com.mongodb.util;version="2.12.4.RELEASE",com.
 mongodb.gridfs;version="2.12.4.RELEASE",org.bson;version="2.12.4.RELE
 ASE",org.bson.util;version="2.12.4.RELEASE",org.bson.util.annotations
 ;version="2.12.4.RELEASE",org.bson.types;version="2.12.4.RELEASE",org
 .bson.io;version="2.12.4.RELEASE"

Responses