Issue with Gatling Maven Plugin with Maven 3.3.1

643 views
Skip to first unread message

Matt Anderson

unread,
Mar 20, 2015, 3:25:27 PM3/20/15
to gat...@googlegroups.com
I built my first Gatling test and am using the gatling-maven-plugin to run it.  On my laptop, I am using Maven 3.0.4 and everything runs just fine.  I recently moved it to another machine with Maven 3.3.1 installed and it fails with the following error:

java.lang.reflect.InvocationTargetException
     at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java
.lang.reflect.Method.invoke(Method.java:497)
     at io
.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
     at io
.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
 
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
     at io
.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:39)
     at scala
.Function0$class.apply$mcV$sp(Function0.scala:40)
     at scala
.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
     at scala
.App$$anonfun$main$1.apply(App.scala:71)
     at scala
.App$$anonfun$main$1.apply(App.scala:71)
     at scala
.collection.immutable.List.foreach(List.scala:318)
     at scala
.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
     at scala
.App$class.main(App.scala:71)
     at io
.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:35)
     at io
.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
     
... 6 more
 
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
     at java
.net.URLClassLoader.findClass(URLClassLoader.java:381)
     at java
.lang.ClassLoader.loadClass(ClassLoader.java:424)
     at sun
.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
     at java
.lang.ClassLoader.loadClass(ClassLoader.java:357)
     
... 16 more

My local .m2 repository folder has the dependency so I know it was downloaded.  I even tried adding it explicitly to the dependencies so it was more than just a transitive dependency, but no luck.  Has anyone else run into this issue?  Any ideas?  In the mean time I've reverted back to the older version of Maven, but wanted to point this out in case it isn't just user error on my part :)

Thanks,
Matt 


Stéphane LANDELLE

unread,
Mar 20, 2015, 3:56:43 PM3/20/15
to gat...@googlegroups.com
Are you willing to bet a beer that the slf4j-api jar is corrupted in your local repository?

Stéphane Landelle
Lead developer


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Anderson

unread,
Mar 23, 2015, 9:43:26 AM3/23/15
to gat...@googlegroups.com
Good thought, but doesn't seem to be the case.  I deleted the local slf4j dependencies and re-ran Maven 3.3.1.  It downloaded fresh copies and still failed with the above error.  I am able to run the test successfully with Maven 3.2.5 and Maven 3.0.4 on the same machine.

Stéphane LANDELLE

unread,
Mar 23, 2015, 9:50:30 AM3/23/15
to gat...@googlegroups.com
Broken maven downloads the root cause of 99,9% of such issues. I still fail to see what those checksums are for?!

But here, there's an undocumented change in maven 3.3.

I've fixed it a few hours ago:

Cheers,

Stéphane Landelle
Lead developer


Matt Anderson

unread,
Mar 23, 2015, 10:19:05 AM3/23/15
to gat...@googlegroups.com
Awesome!  Thanks for the quick action.

BTW, I like IPA's ;)

Stéphane LANDELLE

unread,
Mar 23, 2015, 10:28:15 AM3/23/15
to gat...@googlegroups.com
You'll have to drop by Paris, France ;)

Stéphane Landelle
Lead developer


Mohit Garg

unread,
Mar 24, 2015, 9:31:35 AM3/24/15
to gat...@googlegroups.com

Hi Everyone!

Please help in writing a scenario in which I want to extract two parameters from the response url.
I also want this variable to be stored in my session object and use it in future.

Here is an example:

.exec(http("my post")
.post(/url)
.check(WHAT to write here to extract data from URL and save it in session variable).saveas("Tokem1")

//
.exec()
.post().
QueryParam("Token",${Token1})
)



Please help in writing the .scala file for above scenario?

Stéphane LANDELLE

unread,
Mar 24, 2015, 9:38:00 AM3/24/15
to gat...@googlegroups.com
Please:
  • don't highjack an existing unrelated thread
  • read the documentation first

Stéphane Landelle
Lead developer


--
Reply all
Reply to author
Forward
0 new messages