1
votes

I am trying to execute a JMeter Test Plan which have HTTP Cookie Manager.The Test Plan run successfully in standalone JMeter but fails when try to run using JMeter maven plugin. I am getting following error on the jmx. log file.

ERROR o.a.j.p.h.c.CookieManager: Unable to load or invoke class: org.apache.jmeter.protocol.http.control.HC3CookieHandler
org.apache.jorphan.util.JMeterException: java.lang.ClassNotFoundException: org.apache.jmeter.protocol.http.control.HC3CookieHandler
        at org.apache.jorphan.reflect.ClassTools.construct(ClassTools.java:92) ~[jorphan-3.2.jar:3.2 r1790748]
        at org.apache.jmeter.protocol.http.control.CookieManager.testStarted(CookieManager.java:415) [ApacheJMeter_http-3.2.jar:3.2 r1790748]
        at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:218) [ApacheJMeter_core-3.2.jar:3.2 r1790748]
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:388) [ApacheJMeter_core-3.2.jar:3.2 r1790748]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
Caused by: java.lang.ClassNotFoundException: org.apache.jmeter.protocol.http.control.HC3CookieHandler
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_172]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_172]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_172]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_172]
        at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_172]
        at org.apache.jorphan.reflect.ClassTools.construct(ClassTools.java:86) ~[jorphan-3.2.jar:3.2 r1790748]
        ... 4 more

When I remove HTTP Cookie Manager sampler from Test Plan, above Error doesn't occur. Appreciate any clue to resolve this issue.

POM Configuration done like below

<build>
    <plugins>
        <plugin>
            <groupId>com.lazerycode.jmeter</groupId>
            <artifactId>jmeter-maven-plugin</artifactId>
            <version>2.7.0</version>
            <executions>
                <execution>
                    <id>jmeter-tests</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jmeter</goal>
                        <goal>results</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <jmeterVersion>4.0</jmeterVersion>
                <jmeterExtensions>
                </jmeterExtensions>
                <propertiesUser>
                </propertiesUser>
                <downloadExtensionDependencies>false</downloadExtensionDependencies>
                <propertiesFilesDirectory>${basedir}/src/test/resources</propertiesFilesDirectory>
                <testFilesDirectory>${basedir}/src/test/jmeter</testFilesDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

enter image description here

1

1 Answers

1
votes

As per What's New in JMeter 3.3?

HTTP Cookie Manager Implementation Box Removed

My expectation is that your existing Test Plan has HC3CookieHandler in the "Implementation" drop-down which is not compatible with JMeter 4.0 which is a transitive dependency of the jmeter-maven-plugin 2.7.0

The suggested workaround is:

  1. Open your Test Plan with JMeter 3.2 or earlier
  2. Remove HTTP Cookie Manager from your Test Plan
  3. Open your Test Plan with JMeter 4.0
  4. Add HTTP Cookie Manager back and configure according to your requirements.