2

I'm facing an issue in the JMeter run, where while running the JMeter using the docker it is happening. In the JMeter, it is working fine. But in the terminal, by using docker this error is coming.

Not using maven. I'm just running the below-mentioned docker command.

sudo docker run --mount type=bind,source="/home/user/Downloads/apache-jmeter-5.4.1/bin/",target="/opt/apache-jmeter-5.3/bin" jmeter -n -t bin/Assignment2.jmx -l bin/example-run29.jtl

This is the jtl file result that I'm getting after the run.

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1621688749004,13,JDBC Request,null 0,java.sql.SQLException: Cannot load JDBC driver class 'org.postgresql.Driver',Thread Group 1-1,text,false,,53,0,1,1,null,0,0,13

4
  • Please edit the post and provide the full stack trace, the dockerfile and some details of your project setup (e.g. relevant parts of the pom.xml if you are using maven). Commented May 22, 2021 at 13:23
  • Could you provide your Dockerfile? Commented May 22, 2021 at 13:23
  • Not using maven. I'm just running the below-mentioned docker command. sudo docker run --mount type=bind,source="/home/user/Downloads/apache-jmeter-5.4.1/bin/",target="/opt/apache-jmeter-5.3/bin" jmeter -n -t bin/Assignment2.jmx -l bin/example-run29.jtl Commented May 22, 2021 at 13:27
  • @ErangaHeshan This is the jtl file result that I'm getting after the run. timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1621688749004,13,JDBC Request,null 0,java.sql.SQLException: Cannot load JDBC driver class 'org.postgresql.Driver',Thread Group 1-1,text,false,,53,0,1,1,null,0,0,13 Commented May 22, 2021 at 13:29

1 Answer 1

2

It looks like you don't have PostgreSQL JDBC Driver in the JMeter Classpath so you need to either copy the file (it should be something like postgresql-xx.x.xx.jar, the latest one is https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.20/postgresql-42.2.20.jar or amend your Dockerfile to automatically download this driver and place it to the JMeter Classpath, something like:

RUN wget wget https://jdbc.postgresql.org/download/postgresql-42.2.20.jar
RUN mv postgresql-42.2.20.jar /path/to/your/jmeter/lib

More information: How to use Different JDBC Drivers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.