Issue in executing gatling-maven-plugin:2.1.6 on jenkins -

Hi

I’m running into issues in running my gatling project on Jenkins. Its working fine on my local, but not able to build through Jenkins.

These are my versions:

<gatling.version>2.1.6</gatling.version>
<gatling-plugin.version>2.1.6</gatling-plugin.version>
<scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>

I did see posts on issues when we have spaces in the job name, and paths. I had made sure I’ve no spaces in the path to my Jenkins war, gatling project and Jenkins Job name.

This is the error I’m seeing, when running with -X enabled:


org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile, org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile, org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile]
[DEBUG]   (f) bodiesFolder = C:\WIP\gatling\test1-perf\test1-perf\src\test\resources\bodies
[DEBUG]   (f) compiledClassesFolder = C:\WIP\gatling\test1-perf\test1-perf\target\test-classes
[DEBUG]   (f) configFolder = C:\WIP\gatling\test1-perf\test1-perf\src\test\resources
[DEBUG]   (f) dataFolder = C:\WIP\gatling\test1-perf\test1-perf\src\test\resources\data
[DEBUG]   (f) disableCompiler = false
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) jvmArgs = []
[DEBUG]   (f) mavenProject = MavenProject: com.optum:test1-perf:1.0.0-SNAPSHOT @ C:\WIP\gatling\test1-perf\test1-perf\pom.xml
[DEBUG]   (f) noReports = false
[DEBUG]   (f) overrideGatlingJvmArgs = false
[DEBUG]   (f) overrideZincJvmArgs = false
[DEBUG]   (f) propagateSystemProperties = true
[DEBUG]   (f) reportsDirectory = C:\WIP\gatling\test1-perf\test1-perf\target\gatling
[DEBUG]   (f) resultsFolder = C:\WIP\gatling\test1-perf\test1-perf\target\gatling\results
[DEBUG]   (f) runMultipleSimulations = false
[DEBUG]   (f) session = [org.apache.maven.execution.MavenSession@39b2f2ce](mailto:org.apache.maven.execution.MavenSession@39b2f2ce)
[DEBUG]   (f) simulationsFolder = C:\WIP\gatling\test1-perf\test1-perf\src\test\scala
[DEBUG]   (f) skip = false
[DEBUG]   (f) zincJvmArgs = []
[DEBUG] -- end configuration --
Error: Could not find or load main class Files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.449s
[INFO] Finished at: Fri Jul 31 17:05:35 EDT 2015
[INFO] Final Memory: 12M/240M
[INFO] ------------------------------------------------------------------------

Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.1.6:execute (default) on project test1-perf: Gatling failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.gatling:gatling-maven-plugin:2.1.6:execute (default) on project test1-perf: Gatling failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
	at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:178)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
	at hudson.remoting.UserRequest.perform(UserRequest.java:121)
	at hudson.remoting.UserRequest.perform(UserRequest.java:49)
	at hudson.remoting.Request$2.run(Request.java:326)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.maven.plugin.MojoExecutionException: Gatling failed.
	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:191)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 30 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:151)
	at io.gatling.mojo.Fork.run(Fork.java:81)
	at io.gatling.mojo.GatlingMojo.executeGatling(GatlingMojo.java:216)
	at io.gatling.mojo.GatlingMojo.execute(GatlingMojo.java:186)
	... 32 more

Error: Could not find or load main class Files is typical of a java command line where some space messes everything up.
You’re running on Windows, so there’s a very good chance your JDK is located in Program Files, that… contains a space!

Try adding a logback-test.xml that sets the logging level to DEBUG, you might see the full command line.

Hi Antony

I am facing the same issue where my gatling-maven project is throwing an error, “Error: Could not find or load main class Files”

Were you able to fix the issue that you got? If yes, could you please share how?

I do not have any spaces in my paths. Also, I have the following versions:

<gatling.version>2.1.7</gatling.version>
<gatling-plugin.version>2.1.7</gatling-plugin.version>
<scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>

Thanks in advance!

Regards
Parul

Hello Parul,

Were you able to resolve this issue?
If yes, how?

Thanks.

Atul

I had the same issue,

So I created a junction (directory link in ntfs) between C:\Java and C:\Program Files\Java using the command

mklink /J C:\Java “C:\Program Files\Java”

Afterwards I set the JAVA_HOME variable to C:\Java\jdk…

That worked for me in command line, BUT: as soon as I run the maven build from Intellij it failed with the same error - unless I start the build in debug mode o_O … however, I suspect the IntelliJ Launcher and the IntelliJ installpath to be the culprit, because the Gatling process is forked from the maven process and presumably inherits some of its commandline args:

C:\Java\jdk1.8.0_65\bin\java … “-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\bin” -classpath “D:\tools\apache-maven-3.3.3\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\lib\idea_rt.jar” com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=15.0.4

I re-installed IntelliJ in another directory WITHOUT spaces, and that did it for me.

Issue fixed: https://github.com/gatling/gatling/issues/3078

Cheers,