add mongo-java-driver-3.9.0.jar /lib/ext jsr223 scprits: import com.mongodb.* import com.mongodb.MongoCredential import com.mongodb.BasicDBObject MongoCredential coreCredential =MongoCredential.createCredential("admin", "admin", "admin".toCharArray()); MongoClient coreMongoClient = new MongoClient(new ServerAddress("${ServerIp}", 27017), Arrays.asList(coreCredential)); error: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static com.mongodb.MongoCredential.createCredential() is applicable for argument types: (java.lang.String, java.lang.String, [C) values: [admin, admin, admin] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72) ~[groovy-all-2.4.10.jar:2.4.10] at javax.script.CompiledScript.eval(Unknown Source) ~[?:1.8.0_131] at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:221) ~[ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.protocol.java.sampler.JSR223Sampler.sample(JSR223Sampler.java:71) [ApacheJMeter_java.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.0 r1840935] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.0 r1840935] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131] Caused by: groovy.lang.MissingMethodException: No signature of method: static com.mongodb.MongoCredential.createCredential() is applicable for argument types: (java.lang.String, java.lang.String, [C) values: [admin, admin, admin] at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1506) ~[groovy-all-2.4.10.jar:2.4.10] at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1492) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141) ~[groovy-all-2.4.10.jar:2.4.10] at Script22.run(Script22.groovy:4) ~[?:?] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317) ~[groovy-all-2.4.10.jar:2.4.10] ... 9 more but, in jmeter3.2 that's ok
JMeter comes with a very old copy of MongoDB client library. You will have to remove those from the JMeter class path before you can add a newer version. This report can basically be split in two things: - an enhancement request to update the MongoDB client library. - a question on how to add jars to JMeter without shooting oneself into ones own foot. The first one is difficult and has been discussed before on the mailing list. The second would be a good candidate to be asked on the mailing list. I am therefore closing this report as invalid. Feel free to ask on the mailing list for more help if needed.
yes, I put in the wrong directory, that's "lib/mongo-java-driver-3.9.0.jar"
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4928