I am trying to implement a JavaScript Adapter that uses the mongodb java driver. I've downloaded the mongodb driver.
The dependency in my pom.xml looks like this:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.2.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/mongo-java-driver-3.2.2.jar</systemPath>
</dependency>
In the implementation, I am trying to instantiate MongoClient:
var mongoClient = new com.mongodb.MongoClient();
If I try to call the adapter, I am getting an error:
25.05.16 14:13:45:301 MESZ] 0000bb8c com.ibm.mfp.server.js.adapter.internal.JavascriptManagerImpl E FWLST0904E: Exception was thrown while invoking procedure: getFeed in adapter: MongoAdapter org.mozilla.javascript.EcmaError: TypeError: [JavaPackage com.mongodb.MongoClient] is not a function, it is object. (MongoAdapter-impl.js#20)
Seems like, the jar is not loaded properly, even though the adapter builds without errors.
I've uploaded a small sample adapter project here.