具体报错:

2020-06-30 16:59:04,466 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'JDBC Request-insert'.

at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:1.8.0_251]
at java.lang.Long.parseLong(Unknown Source) ~[?:1.8.0_251]
at java.lang.Long.parseLong(Unknown Source) ~[?:1.8.0_251]
at org.apache.jmeter.functions.Random.execute(Random.java:64) ~[ApacheJMeter_functions.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:135) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:110) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:100) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.modifiers.UserParameters.setValues(UserParameters.java:156) ~[ApacheJMeter_components.jar:5.3]
at org.apache.jmeter.modifiers.UserParameters.process(UserParameters.java:141) ~[ApacheJMeter_components.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.runPreProcessors(JMeterThread.java:950) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:549) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]

jmeter 连接SQLServer执行insert语句时, JDBC Request 报错:java.lang.NumberFormatException: For input string: ""解决方法

 

解决方法:

1.查看下insert sql语句中的每个字段值是否正确,我这里是因为参数化了,但是字段参数化有问题,所以导致报错;问题如下:

jmeter 连接SQLServer执行insert语句时, JDBC Request 报错:java.lang.NumberFormatException: For input string: ""解决方法

 

2,查看下insert操作时,字段的类型是否正确,字段类型转换是否正确,否则也会报错,尤其注意date类型的参数化,时间戳比较容易出问题,

https://blog.csdn.net/jocleyn/article/details/83414433

我这里后来改为了:${__time(yyyy-MM-dd HH:mm:ss:SSS,time)}  ,错误得以解决

jmeter 连接SQLServer执行insert语句时, JDBC Request 报错:java.lang.NumberFormatException: For input string: ""解决方法

相关文章:

  • 2021-07-04
  • 2021-06-29
  • 2021-07-20
  • 2021-07-19
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2021-12-30
  • 2021-12-15
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
相关资源
相似解决方案