Migrating to snapshot

191 views
Skip to first unread message

Michelle Burrows

unread,
May 27, 2014, 12:30:41 PM5/27/14
to gat...@googlegroups.com
I'm currently migrating from 2M3a to snapshot and running into a few problems:

I'm unable to import external libraries, e.g., at import org.apache.commons.lang._ I get the following error: object lang is not a member of package org.apache.commons

I'm also getting not found: value atOnce and the same for constantRate. I'm still calling them the same way as before - will changing from atOnce(x users) to atOnce(x) fix it?

Stéphane Landelle

unread,
May 27, 2014, 12:52:38 PM5/27/14
to gat...@googlegroups.com
I'm unable to import external libraries, e.g., at import org.apache.commons.lang._ I get the following error: object lang is not a member of package org.apache.commons

How do you run Gatling and how did you ship commons-lang (that Gatling doesn't ship itself)?

I'm also getting not found: value atOnce and the same for constantRate. I'm still calling them the same way as before - will changing from atOnce(x users) to atOnce(x) fix it?

Michelle Burrows

unread,
May 27, 2014, 1:25:22 PM5/27/14
to gat...@googlegroups.com
I run bin/gatling.sh and use the simulation menu. And I didn't do anything before other than add the import statements - maybe 2M3a was using it and snapshot doesn't? Dropped the commons-lang jar into $GATLING_HOME/lib and still having the same problem. 

Since the migration documentation is a little brief, full list of new names in injection API, for future reference:

rampUsers(users: Int)
heavisideUsers(users: Int)
atOnceUsers(users: Int)
splitUsers(users: Int)
constantUsersPerSec(rate: Double)
rampUsersPerSec(rate1: Double)
nothingFor(d: FiniteDuration)

Stéphane Landelle

unread,
May 27, 2014, 2:01:59 PM5/27/14
to gat...@googlegroups.com
maybe 2M3a was using it and snapshot doesn't?

Yes, that's it.
 
Dropped the commons-lang jar into $GATLING_HOME/lib and still having the same problem. 

Should work.
Maybe you have to touch the Simulation file in order to trigger recompilation.

Michelle Burrows

unread,
May 27, 2014, 2:17:33 PM5/27/14
to gat...@googlegroups.com
Touched all of my source files, lib/ and all of the jars, and checked to make sure CLASSPATH is being set properly. Still thinks there's no such thing as lang. I'm sure it's recompiling, because my other compiler errors have disappeared.

Stéphane Landelle

unread,
May 27, 2014, 2:51:00 PM5/27/14
to gat...@googlegroups.com
That's weird.
Are you sure that the commons-lang jar you placed in lib is fine (that it's binaries and not sources and that it's not corrupted and can properly be decompressed)?


--
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.

Michelle Burrows

unread,
May 27, 2014, 3:12:11 PM5/27/14
to gat...@googlegroups.com
Same problem and solution as here.

Accidentally downloaded commons-lang3 instead of commons-lang 2.6, thanks to both of them being on the "download Apache commons lang" page with no note of the package name changing between versions. That took up way too much of my day. Wouldn't have caught it if I hadn't extracted the jar, though - thanks!

Stéphane Landelle

unread,
May 27, 2014, 3:18:02 PM5/27/14
to gat...@googlegroups.com
Yeah, sometimes when things just don't make sense, a little perspective can help :)
Glad you could solve this mystery.

Michelle Burrows

unread,
May 27, 2014, 3:25:21 PM5/27/14
to gat...@googlegroups.com
Shoot, one last (hopefully) error:

  check(regex("<input type=\"hidden\" name=\"SAMLResponse\" value=\"([^\"]+)\"")
      .transform(_.map(StringEscapeUtils.unescapeHtml(_)))
      .saveAs("SAMLResponse")

throws the following:

 type mismatch;
 found   : Char
 required: String

Stéphane Landelle

unread,
May 27, 2014, 3:32:03 PM5/27/14
to gat...@googlegroups.com
transform 2M3 signature was too cumbersome for most use cases.

Now transform is (T1 => T2) and fullTransform is (Option[T1] => Option[T2])

So that's:
.transform(StringEscapeUtils.unescapeHtml)

or (but in this case I wouldn't advice so):
.fullTransform(_.map(StringEscapeUtils.unescapeHtml))


Michelle Burrows

unread,
May 27, 2014, 3:39:33 PM5/27/14
to gat...@googlegroups.com
Fantastic, looks like everything's up and running! Thank you so much!

Stéphane Landelle

unread,
May 27, 2014, 3:49:15 PM5/27/14
to gat...@googlegroups.com
Glad I could help.
have fun!

nadine.w...@nike.com

unread,
Jul 22, 2014, 1:55:51 PM7/22/14
to gat...@googlegroups.com
@Michelle - Thanks for posting this!

Michelle Burrows

unread,
Jul 22, 2014, 2:09:09 PM7/22/14
to gat...@googlegroups.com
No problem! I realized earlier today that it's not actually complete (I just did a quick copy/paste at the time, apparently without paying attention), though. Here are the full signatures as they're actually used:

rampUsers(users: Int) over(d: FiniteDuration)
heavisideUsers(users: Int) over(d: FiniteDuration)
atOnceUsers(users: Int)
splitUsers(users: Int) into(step: InjectionStep) separatedBy(separator: InjectionStep)
splitUsers(users: Int) into(step: InjectionStep) separatedBy(duration: FiniteDuration)
constantUsersPerSec(rate: Double) during(d: FiniteDuration)
rampUsersPerSec(rate1: Double) to(rate2: Double) during(d: FiniteDuration)
nothingFor(d: FiniteDuration)

nadine.w...@nike.com

unread,
Jul 22, 2014, 8:44:03 PM7/22/14
to gat...@googlegroups.com
Ah, I was wondering which ones could be used with qualifiers. 

What is "heavisideUsers"? Have you tried using that one?

Michelle Burrows

unread,
Jul 23, 2014, 8:30:19 AM7/23/14
to gat...@googlegroups.com
I haven't used it, but there's some information on it here.

nadine.w...@nike.com

unread,
Jul 23, 2014, 12:07:11 PM7/23/14
to gat...@googlegroups.com
Thank you very much.
Reply all
Reply to author
Forward
0 new messages