# Where is jsonFile?

**URL:** <https://community.gatling.io/t/where-is-jsonfile/1309>\
**Category:** Gatling (Open-Source)\
**Created:** [August 20, 2014, 6:48pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309 "2014-08-20T18:48:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Raible](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Matt\_Raible](https://community.gatling.io/u/Matt_Raible)\
**Post date:** [August 20, 2014, 6:48pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/1 "2014-08-20T18:48:09Z")

</div>

Hello all,

In the feeder documentation[1], it mentions you can use JSON as a feeder source.

```auto
val jsonFileFeeder = jsonFile("foo.json")
val jsonUrlFeeder = jsonUrl("http://me.com/foo.json")

```

I can’t seem to find the right import for jsonFile. Any pointers?

Thanks,

Matt

[1] [http://gatling.io/docs/2.0.0-SNAPSHOT/session/feeder.html#feeder](http://gatling.io/docs/2.0.0-SNAPSHOT/session/feeder.html#feeder)

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [August 20, 2014, 7:05pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/2 "2014-08-20T19:05:15Z")

</div>

Hi Matt,

Almost all feeders, except for the JDBC,Redis and Sitemap ones, are available when you import i_o.gatling.core.Predef.\__

For the other feeders :

- The JDBC feeder is available after importing _io.gatling.jdbc.Predef.\__
- The Sitemap feeder is available after importing _io.gatling.http.Predef.\__
- The Redis feeder is available after importing _io.gatling.redis.Predef.\__

Just make sure you imported i_o.gatling.core.Predef.\__ and it’ll be fine 🙂

Cheers,

Pierre

---

<div class="post-metadata">

**Author:** ![Matt\_Raible](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Matt\_Raible](https://community.gatling.io/u/Matt_Raible)\
**Post date:** [August 20, 2014, 7:10pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/3 "2014-08-20T19:10:18Z")

</div>

That’s what I figured. However, I’m getting the following error:

: error: not found: value jsonFile  
[ERROR] val searchFeeder = jsonFile(“data/memberSearch.json”)  
[ERROR] ^  
[ERROR] one error found  
[INFO] ------------------------------------------------------------------------  
[INFO] BUILD FAILURE

I have the following imports:

import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_  
import io.gatling.jdbc.Predef.\_

I’m using 2.0.0-M3a. Is there a newer version I should be using?

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [August 20, 2014, 7:18pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/4 "2014-08-20T19:18:58Z")

</div>

Ah, 2.0.0-M3a does not ship the JSON feeders.  
There is a indeed a newer version, Gatling 2.0.0-RC2, which ships the JSON feeders.  
Not to mention that M3a is rather old and many bugs were fixed since then.

You should migrate to 2.0.0-RC2, until we release the stable version in September (hopefully).  
There is a dedicated migration guide for moving to 2.0.0-RC2 from 2.0.0-M3a : [http://gatling.io/docs/2.0.0-RC2/project/migration\_guides/2.0.0-M3a-to-2.0.0-RC2.html#m3a-to-2-0-rc2](http://gatling.io/docs/2.0.0-RC2/project/migration_guides/2.0.0-M3a-to-2.0.0-RC2.html#m3a-to-2-0-rc2)  
Don’t hesitate to ask questions in this group should you need some help during migration 🙂

Cheers,

Pierre

---

<div class="post-metadata">

**Author:** ![Matt\_Raible](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Matt\_Raible](https://community.gatling.io/u/Matt_Raible)\
**Post date:** [August 20, 2014, 7:47pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/5 "2014-08-20T19:47:42Z")

</div>

Thanks for the tip. I’ve attempted to migrate my project to 2.0.0-RC2. However, I get the following compilation error:

Error:(19, 17) type mismatch;  
found : String(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
required: io.gatling.core.session.Session =\> io.gatling.core.validation.Validation[String]  
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
^

What needs to change in my http configuration? Here’s my full definition:

val host = System.getProperty(“host”, “localhost:8080”)

val httpProtocol = http  
.baseURL(“http://” + host)  
.acceptHeader(“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8”)  
.doNotTrackHeader(“1”)  
.acceptLanguageHeader(“en-US,en;q=0.5”)  
.acceptEncodingHeader(“gzip, deflate”)  
.userAgentHeader(“Gatling 2.0”)

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [August 20, 2014, 8:00pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/6 "2014-08-20T20:00:15Z")

</div>

That’s rather strange…  
As long as _io.gatling.core.Predef.\__ is imported, an implicit conversion should kick in and convert your String to an _Expression[String]_, which is an alias for _Session =\> Validation[String]_.

---

<div class="post-metadata">

**Author:** ![Matt\_Raible](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Matt\_Raible](https://community.gatling.io/u/Matt_Raible)\
**Post date:** [August 20, 2014, 8:09pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/7 "2014-08-20T20:09:39Z")

</div>

I was missing that import - thanks for the tip. Migration complete!

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [August 20, 2014, 8:19pm UTC](https://community.gatling.io/t/where-is-jsonfile/1309/8 "2014-08-20T20:19:52Z")

</div>

Glad it went so smoothly 😉
