验证查询通过时,来自jdbc请求的查询不会传递给数据库,该怎么办?

时间:2019-01-31 07:27:38

标签: java jdbc jmeter

我正在尝试将JMeter测试工具与JDBC连接器连接到我的数据库。我打开了一组线程以及JDBC连接配置和JDBC请求。

当我运行测试时,它没有在“查看结果树”中给我任何结果,也没有将查询发送到我的数据库,但是当我查看数据库中的日志时,我看到验证查询“ select 1”通过了,所以我猜连接很好,但是从“ jdbc request”页面发送的查询中有问题

我收到以下错误Error while processing sampler: 'JDBC Request'.  帮助任何人?

日志:

2019-01-31 10:27:51,840 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2019-01-31 10:27:51,848 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2019-01-31 10:27:51,849 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2019-01-31 10:27:52,012 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2019-01-31 10:27:52,012 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2019-01-31 10:27:52,012 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-01-31 10:27:52,012 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2019-01-31 10:27:52,012 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-01-31 10:27:52,012 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-01-31 10:27:52,013 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2019-01-31 10:27:52,218 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'JDBC Request'.
java.lang.NullPointerException: null
    at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:89) ~[ApacheJMeter_jdbc.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(Thread.java:748) [?:1.8.0_161]
2019-01-31 10:27:52,219 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2019-01-31 10:27:52,219 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2019-01-31 10:27:52,219 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-01-31 10:27:52,224 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

1 个答案:

答案 0 :(得分:0)

更新您的JDBC驱动程序。对于后退current version is 42.2.5。下载,复制到JMeter\lib目录,然后重新启动JMeter。