Closed andreacfm closed 14 years ago
Hey Andrea, Thanks for the work!
I pulled the replica set additions, and when I run the tests I get: coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.java.JavaObjectInstantiationException : Object instantiation exception.An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. Error: ''.][java.lang.reflect.InvocationTargetException : null][java.lang.ClassCastException : com.mongodb.ServerAddress cannot be cast to com.mongodb.ServerAddress]
This is at line 13 in Mongo.cfc, at variables.mongo.init( mongoConfig.getServers() )
Any ideas?
Hey Andrea,
I figured it out. I'll respond with more detail tomorrow... it's late here!
And thanks again! This will be a great addition
Mark, I think you are loading the jar twice. That's why I avoid using javaloader . Btw I test anything on Railo so I can see if code gets compatible with Railo too.
Andrea,
Yup, that was it. I've been using javaloader exclusively b/c it makes things much easier for me, and I still had an old mongo jar in my lib folder. your MOngoConfig was creating objects directly, and it was using the mongo in my lib and not the one that javaloader uses.
I think what I'm going to do is change MongoConfig so that it accepts the factory, adn then just have Mongo.cfc get its object factory ot of MongoConfig. This will let us use the factory (either the default or javaloader) in both mongoconfig and mongo, along with all the other places.
Just so you know how the factory works: if you want to use javaloader, you create an instance of the JavaloaderFactory and pass it in a preinitialized javaloader instance. If you want to use the jars in your server's lib folder, you don't do anything.
Thanks Mark,
well done.
Andrea
Initial support for replica sets in mongodb. This commit just includes the ability to pass to mongoConfig an array of adrresses. Mongo client now knows the replica nodes and will try to contact the master. Still miss the lability to wait for sets to elect a new master if one fails.