1
votes

Trying to create a simple Jmeter 5.0 test to connect to a database using JDBC Connection Configuration. It's failing to connect to my local mySql database. [jdbc:mysql://localhost:3306]. I can connect to my local mySql database using MySQL WorkBench so I know I can connect to it.

It appears to be failing on the com.mysql.jdbc.Connection.isValid method.

2019-07-02 13:24:22,730 ERROR o.a.j.JMeter: Uncaught exception: java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z

I am using jmeter 5.0 and have tried different mysql-connector-java jar versions (i.e. 5.1.1.jar and 8.0.16.jar).

Any thoughts why this might be happening?

I have tried different mysql-connector-java jar files in my apache-jmeter-5.0\bin, but it appears to not be working. It's almost like jmeter is grabbing another file on my computer but not positive.

2019-07-02 13:24:22,730 ERROR o.a.j.JMeter: Uncaught exception: java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z at org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:862) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:270) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:376) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2346) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2329) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2071) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1525) ~[commons-dbcp2-2.4.0.jar:2.4.0] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:326) ~[ApacheJMeter_jdbc.jar:5.0 r1840935] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:191) ~[ApacheJMeter_jdbc.jar:5.0 r1840935] at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:79) ~[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(Unknown Source) [?:1.8.0_161]

1

1 Answers

0
votes

It appears the mysql-connector.jar file in the "Java\jre1.8.0_161\lib\ext" folder was conflicting with the mysql-connector-java-8 jar file in the "jmeter\lib" folder. After removing the file from the java folder the jdbc request worked.