[JAVA-3162] Problem with OSGi framework when I use mongodb-driver and mongodb-driver-core Created: 04/Feb/19  Updated: 27/Oct/23  Resolved: 04/Feb/19

Status: Closed
Project: Java Driver
Component/s: Packaging
Affects Version/s: 3.9.1
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jorge Garcia-Mochales Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Software platform



 Description   

Hi

I work with OSGi Framework and I have a bundle who works with the jars: mongodb-driver and mongodb-driver-core. For example, I use org.mongodb.BasicDBObject (from mongodb-driver-core) and org.mongodb.DB (from mongodb-driver). When I import the package org.mongodb in the file manifest.mf of my bundle I only can choose one mongodb jar. 

¿Which solucions are posible?

Thanks.



 Comments   
Comment by Ross Lawley [ 04/Feb/19 ]

Hi jmochales,

The mongodb-driver documentation covers OSGI support:

IMPORTANT
mongodb-driver is not an OSGi bundle: both mongodb-driver and mongodb-driver-core, a dependency of mongodb-driver, include classes from the com.mongodb package.

For OSGi-based applications, use the mongodb-driver-sync or the mongo-java-driver uber jar instead.

It is also not a Java 9 module.

This module is deprecated and will no longer be published in the next major release of the driver (4.0).

Just to let you know for future reference, this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the mongodb-user mailinglist or stackoverflow as you will reach a broader audience there. If your business requires an answer from MongoDB within a time frame then we do offer production support.

Ross

Generated at Thu Feb 08 08:58:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.