Vel Ganesh
Vel Ganesh

Reputation: 553

How to open a java package while running jmeter scripts from JMeter?

I am running Jmeter scripts via Maven & Jenkins. The script needs parallel controller plugin for execution. It throws the below error during execution. module java.base does not "opens java.lang" to unnamed module @366647c2

How to add the below JVM argument to pom.xml to fix this issue? --add-opens java.base/java.lang=ALL-UNNAMED

OpenJDK Runtime Environment Microsoft-8552009 (build 17.0.9+8-LTS)
com.blazemeter:jmeter-parallel:0.12
com.lazerycode.jmeter:jmeter-maven-plugin:3.8.0

enter image description here

enter image description here

Upvotes: 0

Views: 31

Answers (2)

Vel Ganesh
Vel Ganesh

Reputation: 553

Setting the JVM options to the JDK_JAVA_OPTIONS environment variable fixes this issue.

Upvotes: 0

Ivan G
Ivan G

Reputation: 2907

You can pass the property to mvn command like:

MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED" && mvn clean install

In POM you can use jMeterProcessJVMSettings section like:

<configuration>
    <jMeterProcessJVMSettings>
        <arguments>
            <argument>--add-opens java.base/java.lang=ALL-UNNAMED</argument>
        </arguments>
    </jMeterProcessJVMSettings>
</configuration>

More information:

Upvotes: 1

Related Questions