Trying to create feeder causes java.lang.NoSuchMethodError

349 views
Skip to first unread message

Jonathan Vaughn

unread,
Aug 10, 2016, 9:41:12 PM8/10/16
to Gatling User Group
This is in Gatling 2.2.2

I have a simple CSV I'm trying to use in the user-files/data directory, in the format of:
loginEmail,loginPassword
"test+s...@example.com","password2"
... (etc)

Trying to create the feeder gives an error:

Code:
package example

import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import io.gatling.http.HeaderNames._
import io.gatling.http.check.HttpCheck
import scala.concurrent.duration._
import util.Random
import io.gatling.jsonpath.JsonPath

object Login {
    val loginFeeder = csv("customer_accounts.csv")
...


Removing / commenting the csv line (and anything referencing it) will prevent the error from occurring, though I then have to hard code the values it's meant to replace for the script to actually work. If I put the file somewhere else or otherwise make the path to the file wrong, I get a corresponding error about the CSV file not being found, so it at least gets as far as trying to read the file. Nothing in the CSV file is outside the range of [0-9a-zA-Z] except for the '@' in the email field, and the commas and quotation marks formatting the CSV file itself.

This is the error I get:

Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
        at io.gatling.core.feeder.SeparatedValuesParser$.stream(SeparatedValuesParser.scala:46)
        at io.gatling.core.feeder.SeparatedValuesParser$.io$gatling$core$feeder$SeparatedValuesParser$$$anonfun$1(SeparatedValuesParser.scala:38)
        at io.gatling.core.feeder.SeparatedValuesParser$lambda$$parse$1.apply(SeparatedValuesParser.scala:37)
        at io.gatling.core.feeder.SeparatedValuesParser$lambda$$parse$1.apply(SeparatedValuesParser.scala:37)
        at io.gatling.commons.util.Io$.withCloseable(Io.scala:146)
        at io.gatling.core.feeder.SeparatedValuesParser$.parse(SeparatedValuesParser.scala:37)
        at io.gatling.core.feeder.FeederSupport$class.io$gatling$core$feeder$FeederSupport$class$$$anonfun$1(FeederSupport.scala:44)
        at io.gatling.core.feeder.FeederSupport$class$lambda$$separatedValues$1.apply(FeederSupport.scala:44)
        at io.gatling.core.feeder.FeederSupport$class$lambda$$separatedValues$1.apply(FeederSupport.scala:44)
        at io.gatling.core.feeder.FeederSupport$class.feederBuilder(FeederSupport.scala:52)
        at io.gatling.core.Predef$.feederBuilder(Predef.scala:22)
        at io.gatling.core.feeder.FeederSupport$class.separatedValues(FeederSupport.scala:44)
        at io.gatling.core.Predef$.separatedValues(Predef.scala:22)
        at io.gatling.core.feeder.FeederSupport$class.separatedValues(FeederSupport.scala:41)
        at io.gatling.core.Predef$.separatedValues(Predef.scala:22)
        at io.gatling.core.feeder.FeederSupport$class.csv(FeederSupport.scala:34)
        at io.gatling.core.Predef$.csv(Predef.scala:22)
        at magento.Login$.<init>(Login.scala:19)
        at magento.Login$.<clinit>(Login.scala)
        at magento.MagentoSimulation.<init>(MagentoSimulation.scala:51)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at io.gatling.app.Gatling$.io$gatling$app$Gatling$$$anonfun$1(Gatling.scala:41)
        at io.gatling.app.Gatling$lambda$1.apply(Gatling.scala:41)
        at io.gatling.app.Gatling$lambda$1.apply(Gatling.scala:41)
        at io.gatling.app.Gatling.run(Gatling.scala:92)
        at io.gatling.app.Gatling.runIfNecessary(Gatling.scala:75)
        at io.gatling.app.Gatling.start(Gatling.scala:65)
        at io.gatling.app.Gatling$.start(Gatling.scala:57)
        at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49)
        at io.gatling.app.Gatling$.main(Gatling.scala:43)
        at io.gatling.app.Gatling.main(Gatling.scala)

Any ideas on why it's failing / how to fix it ? 

Stéphane LANDELLE

unread,
Aug 11, 2016, 1:56:48 AM8/11/16
to gat...@googlegroups.com
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader; means "the JVM could find the ObjectMapper class but it's missing the readFor method".

You've done something (that's for you to figure out) that causes your project to ship a jackson-databind version that's older than the one expected by Gatling 2.2.2.

Stéphane Landelle
GatlingCorp CEO


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Vaughn

unread,
Aug 11, 2016, 6:06:38 PM8/11/16
to gat...@googlegroups.com
Thanks, that was it. I upgraded this project from an older version of Gatling where I was using Rapture IO to do some JSON processing and the libraries were conflicting.

--
You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/5LXXRvKggsk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages