Forum Discussion
Hi Saradhipb,
What Ready! API version are you using? Please check if you get the same error in the latest version - v. 1.8.5. You can download the installation file here:
Hi Tanya,
I was using Ready API version 1.7. Downloaded the updated version 1.8.5, I have been facing the same issue. As indicated earlier i am able to run a similar Java code in eclipse successfully.
@Grab(group='com.gmongo', module='gmongo', version='1.3')
import com.mongodb.BasicDBObject
import com.mongodb.DB
import com.mongodb.DBCollection
import com.mongodb.DBCursor
import com.mongodb.MongoClient
import com.mongodb.MongoClientURI
MongoClientURI uri = new MongoClientURI("mongodb://xxxxx:xxxx123@xx.xx.xx.x:27017/xxxxxdb?ssl=true&mechanism='SCRAM-SHA-1'");
MongoClient mongoClient = new MongoClient(uri)
DB db = mongoClient.getDB("xxxxxdb")
DBCollection collec = db.getCollection("yyyyyy")
BasicDBObject query = new BasicDBObject()
DBCursor cursor = collec.find(query)
while (cursor.hasNext()) {
BasicDBObject test= (BasicDBObject)(cursor.next())
log.info test
}
- saradhipb8 years agoOccasional Contributor
Finally I got a solution by using MongoClientOptions
(MongoClientOptions.builder().sslEnabled(true).sslInvalidHostNameAllowed(true).build())
Related Content
- 2 months agoStoplight
- 4 years agoAsadGilani
- 6 years agoAndyTGardner