So I have read the handful of posts on here about attempts to connect Mirth to a MongoDB instance. It looks like the only posts that declare success are ones that implement a REST interface to the DB.
But the official MongoDB JAR should be fairly straight forward to implement. However, I can't seem to get it off the ground. Here is the relevant info:
I have tried with 2 different versions of Mirth 2.2.2 and 3.0.3
I dropped the 2.13 version of the MongoDB Driver JAR into the custom-lib folder and bounced the Mirth server. Then tried to instantiate the MongoDB Client class in a channel like so:
In the Deploy Script
As you can see I tried a few different strategies all to no avail. If I try to use the importPackages function, then the MongoClient declaration errors for being undefined which would mean Mirth can't find the class in the Package (if it was even imported). If I try to just instantiate the one class, I get the dreaded:
After looking at some of the Mirth forum posts regarding this error, I downloaded the source from GitHub and recompiled the JAR to make sure there was no compression but still no dice.
So, my question, other than "What the hell could be the problem?" is, "Has anyone managed to use this driver in Mirth??"
All ideas, help or feedback is appreciated.
I have attached the JAR below.
But the official MongoDB JAR should be fairly straight forward to implement. However, I can't seem to get it off the ground. Here is the relevant info:
I have tried with 2 different versions of Mirth 2.2.2 and 3.0.3
I dropped the 2.13 version of the MongoDB Driver JAR into the custom-lib folder and bounced the Mirth server. Then tried to instantiate the MongoDB Client class in a channel like so:
In the Deploy Script
Code:
//Create DB Client Instance
//importPackage(Packages.com.mongodb);
var mongoClient = new Packages.com.mongodb.MongoClient("localhost",27017);
//var mongoClient = new Packages.com.mongodb.MongoClient()
globalChannelMap.put('mongoDBClient', mongoClient);
As you can see I tried a few different strategies all to no avail. If I try to use the importPackages function, then the MongoClient declaration errors for being undefined which would mean Mirth can't find the class in the Package (if it was even imported). If I try to just instantiate the one class, I get the dreaded:
Quote:
TypeError: [JavaPackage com.mongodb.MongoClient] is not a function, it is object. |
After looking at some of the Mirth forum posts regarding this error, I downloaded the source from GitHub and recompiled the JAR to make sure there was no compression but still no dice.
So, my question, other than "What the hell could be the problem?" is, "Has anyone managed to use this driver in Mirth??"
All ideas, help or feedback is appreciated.
I have attached the JAR below.
MongoDB Driver JAR
0 commentaires:
Enregistrer un commentaire