Reputation: 13
I am trying to connect to mongodb using JSR 223 sampler with groovy. THe signature looks completely fine and The script works fine in JMETER. But it throws error while executing it through maven. Below is the code:
==================
MongoCredential mongoCredential = MongoCredential.createScramSha1Credential("PIDPCR","adm",'pRU6Ref'.toCharArray()); coreMongoClient = new MongoClient(new ServerAddress("${addr}", 27017),Arrays.asList(mongoCredential));
=================
Below is the error thrown:
javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static com.mongodb.MongoCredential.createScramSha1Credential() is applicable for argument types: (java.lang.String, java.lang.String, [C) values:
Upvotes: 1
Views: 1695
Reputation: 34566
JMeter embeds an old version of mongo-java-driver-2.11.3.jar.
So ensure you remove it and add the version that works for your code.
To exclude you can use this tag as per this documentation:
<excludedArtifacts>
Upvotes: 2