How do I add a JDBC driver to the class path of the plugin?

2,462 views
Skip to first unread message

Jorge Medina

unread,
Feb 17, 2012, 4:55:35 PM2/17/12
to Maven JMeter Plugin Users
I am getting the following error when the JMeter test are executed:

2012/02/17 13:43:54 WARN -
jmeter.protocol.jdbc.config.DataSourceElement: Could not load driver:
org.postgresql.Driver java.lang.ClassNotFoundException:
org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:
195)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:
255)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:
274)
at
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:
214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.configure(ResourceLimitingJdbcDataSource.java:
297)
at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement.initPool(DataSourceElement.java:
221)
at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement.testStarted(DataSourceElement.java:
106)
at
org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:
224)
at
org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:
349)
at java.lang.Thread.run(Thread.java:636)

How do I add the JDBC driver to the class path of the plugin?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>jmeter-automation</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JMeter Test Automation</name>

<properties>
<jmeter.plugin.version>1.4</jmeter.plugin.version>
<postgresql.version>9.0-901.jdbc4</postgresql.version>
</properties>

<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>${jmeter.plugin.version}</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- for configuration notes of this plugin take a
look at
http://jmeter.lazerycode.com/releasenotes.txt -->
<testResultsTimestamp>false</testResultsTimestamp>
<reportConfig>
<enable>true</enable>
</reportConfig>
<ignoreResultFailures>true</ignoreResultFailures>
<ignoreResultErrors>true</ignoreResultErrors>
<suppressJMeterOutput>false</suppressJMeterOutput>
<propertiesUser>
<baseUrl>myapp.example.com</baseUrl>
<!-- for user properites -->
</propertiesUser>
<!-- <jmeterDefaultPropertiesFile></
jmeterDefaultPropertiesFile> -->

</configuration>
</plugin>
</plugins>
</build>

</project>

Mark Collin

unread,
Feb 17, 2012, 5:42:32 PM2/17/12
to maven-jmeter...@googlegroups.com
It should work if you add it as a dependency to the plugin itself:

<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>

<version>1.4</version>
<executions>
<execution>
<phase>verify</phase>
<id>jmeter-tests</id>


<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>

<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
</dependencies>

</plugin>
</plugins>
</build>

</configuration>
</plugin>
</plugins>
</build>

</project>

--
You received this message because you are subscribed to the Google Groups
"Maven JMeter Plugin Users" group.
To post to this group, send an email to
maven-jmeter...@googlegroups.com.
To unsubscribe from this group, send email to
maven-jmeter-plugi...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/maven-jmeter-plugin-users?hl=en-GB.


--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

If you have received this email in error please notify postm...@ardescosolutions.com

Jorge Medina

unread,
Feb 17, 2012, 6:09:37 PM2/17/12
to Maven JMeter Plugin Users
Never mind, the dependency must be included into the <plugin>.
> 297)
>         at
> org.apache.jmeter.protocol.jdbc.config.DataSourceElement.initPool(DataSourc eElement.java:
> 221)
>         at
> org.apache.jmeter.protocol.jdbc.config.DataSourceElement.testStarted(DataSo urceElement.java:
> 106)
>         at
> org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(St andardJMeterEngine.java:
> 224)
>         at
> org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java :
> 349)
>         at java.lang.Thread.run(Thread.java:636)
>
> How do I add the JDBC driver to the class path of the plugin?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">

Jorge Medina

unread,
Feb 17, 2012, 6:10:15 PM2/17/12
to Maven JMeter Plugin Users
Thanks Mark.
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
> For more options, visit this group athttp://groups.google.com/group/maven-jmeter-plugin-users?hl=en-GB.
>
> --
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> If you have received this email in error please notify postmas...@ardescosolutions.com
Reply all
Reply to author
Forward
0 new messages