使用JMeter + Maven和https协议

时间:2010-09-08 11:08:11

标签: maven-2 ssl-certificate jmeter

我一直在努力让https请求与JMeter + Maven一起工作。 整个场景是 - Lauch app URL>登录到应用程序(这是https)>在主页(这是http)

我使用JMeter的HTTP代理记录了这些测试。然后,如指定的here将采样器的“HTTP请求协议”更改为“https”

现在当我执行测试表单Maven时,遇到以下异常JMeter日志 -

2010/09/08 16:25:38 ERROR - jmeter.util.JsseSSLManager: Exception occurred java.lang.NullPointerException
at org.apache.jmeter.util.SSLManager.getKeyStore(SSLManager.java:132)
at org.apache.jmeter.util.JsseSSLManager.getContext(JsseSSLManager.java:141)
at org.apache.jmeter.util.JsseSSLManager.<init>(JsseSSLManager.java:88)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.jmeter.util.SSLManager.getInstance(SSLManager.java:231)
at org.apache.jmeter.protocol.http.sampler.HTTPSampler.setupConnection(HTTPSampler.java:148)
at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:404)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:658)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:647)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247)
at java.lang.Thread.run(Thread.java:619)

 2010/09/08 16:25:38 INFO  - jmeter.util.JsseSSLManager: JsseSSLManager installed 
 2010/09/08 16:25:38 WARN  - jmeter.protocol.http.sampler.HTTPSampler: You may have forgotten to set the ssl.provider property in jmeter.properties java.lang.IllegalStateException: SSLContextImpl is not initialized
at com.sun.net.ssl.internal.ssl.SSLContextImpl.engineGetSocketFactory(SSLContextImpl.java:145)
at javax.net.ssl.SSLContext.getSocketFactory(SSLContext.java:260)
at com.sun.net.ssl.SSLContextSpiWrapper.engineGetSocketFactory(SSLSecurity.java:365)
at com.sun.net.ssl.SSLContext.getSocketFactory(SSLContext.java:168)
at org.apache.jmeter.util.JsseSSLManager.setContext(JsseSSLManager.java:101)
at org.apache.jmeter.protocol.http.sampler.HTTPSampler.setupConnection(HTTPSampler.java:160)
at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:404)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:658)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:647)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247)
at java.lang.Thread.run(Thread.java:619)

当我从JMeter本身执行这些测试时,我还没有遇到任何异常。但是在Maven中调用test会导致这个问题

你们有没有能够使用JMeter + Maven在https上成功执行测试

提前致谢 Tarun K

2 个答案:

答案 0 :(得分:0)

JMeter小组建议我使用“jmeter.jar”的更新版本,而不是JMeter Maven插件提供的版本....我将把这个问题标记为已回答,并已在此提交another query方面。

感谢你的时间黑色

~T

答案 1 :(得分:0)

是jmeter适用于https我可以通过maven和https进行jmeter测试,尝试使用keytool将证书添加到server.xml指向的cacerts