Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apache POI library breaking Gatling log parsing logic. #3144

Closed
Srisaibersys opened this issue Sep 15, 2016 · 2 comments
Closed

Apache POI library breaking Gatling log parsing logic. #3144

Srisaibersys opened this issue Sep 15, 2016 · 2 comments

Comments

@Srisaibersys
Copy link

Hi Guys,

We observed that whenever we add Apache poi library in our project, Gatling fails to generate reports.
Does this two libraries have any dependency conflicts ?

We observed that whenever we add compile ('info.folone:poi-scala_2.11:0.15') dependency Gatling logs generation get failed and if we simply remove it, logs get generated.

We have a following dependencies in our project.

dependencies {
//  compile ('commons-collections:commons-collections:3.2')
    compile ('org.scala-lang:scala-library:2.11.8')
    compile ('org.scala-lang:scala-compiler:2.11.8')
    compile ('io.gatling:gatling-core:2.2.2')
    compile ('io.gatling:gatling-app:2.2.2')
    compile ('io.gatling.highcharts:gatling-charts-highcharts:2.2.2') 
    compile ('info.folone:poi-scala_2.11:0.15') 
}

and we got the exceptions as below.

Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <?> at index 56: scalaz/syntax/ApplicativeSyntax$ApplicativeIdV$$anonfun$?$2.class
        at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPath.parse(Unknown Source)
        at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
        at java.nio.file.Paths.get(Unknown Source)
        at io.gatling.commons.util.PathHelper$.string2path(PathHelper.scala:28)
        at io.gatling.commons.util.ScanHelper$$anonfun$$nestedInanonfun$3$1.isDefinedAt(ScanHelper.scala:91)
        at io.gatling.commons.util.ScanHelper$$anonfun$$nestedInanonfun$3$1.isDefinedAt(ScanHelper.scala:90)
        at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:535)
        at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:438)
        at scala.collection.Iterator$class.foreach(Iterator.scala:893)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
        at io.gatling.commons.util.ScanHelper$.deepCopyPackageContent(ScanHelper.scala:108)
        at io.gatling.charts.report.ReportsGenerator.copyAssets$1(ReportsGenerator.scala:43)
        at io.gatling.charts.report.ReportsGenerator.generateFor(ReportsGenerator.scala:58)
        at io.gatling.app.LogFileProcessor.generateReports(RunResultProcessor.scala:64)
        at io.gatling.app.LogFileProcessor.processRunResult(RunResultProcessor.scala:43)
        at io.gatling.app.Gatling.start(Gatling.scala:66)
        at io.gatling.app.Gatling$.start(Gatling.scala:57)
        at io.gatling.app.Gatling$.fromMap(Gatling.scala:45)
        at testauto.Engine$.delayedEndpoint$testauto$Engine$1(Engine.scala:42)
        at testauto.Engine$delayedInit$body.apply(Engine.scala:22)
        at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.App$$anonfun$main$1.apply(App.scala:76)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
        at scala.App$class.main(App.scala:76)
        at testauto.Engine$.main(Engine.scala:22)
        at testauto.Engine.main(Engine.scala)

Code was working fine through eclipse but when we executed same code through exported jar, it didn't able to parse the simulation.log files.

Here is our GatlingPropertiesBuilder look like

object Engine extends App{  
  val props = new GatlingPropertiesBuilder
  props.dataDirectory("jar")
  props.simulationClass(classOf[Injector].getName)
  println("properties are " + props.build.toString())
  props.noReports
  /*Windows machine setting for saving results locally*/
  val thePath = "E:/testautomation/gatling";
  val thePath1 = URLEncoder.encode(thePath, "UTF-8"); 
  props.resultsDirectory(thePath1)
  /*even we tried*/
  //props.resultsDirectory("E:/testautomation/gatling")
  Gatling.fromMap(props.build)
  sys.exit()
}
@slandelle
Copy link
Member

Nah, there's absolutely no problem with having scala-poi or scalaz in the classpath.

I'm pretty sure you're re-packaging Gatling as a fatjar (a pretty good hint is your props.dataDirectory("jar") hack tentative), which we don't support. Please use one of the supported usages: bundle, maven or sbt.

@Srisaibersys
Copy link
Author

Hi Guys,

I tried with updated dependencies and it works :)

In my current build.gradle file compile ('info.folone:poi-scala_2.11:0.15') compile jar is replaced with new POI Entries

 compile group: 'org.apache.poi', name: 'poi', version: '3.9'
    compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants