[Gatling 2.0.0-M3] Can't get HAR archives to load in Recorder

Greetings. I have a HAR archive sitting on my desktop as foo.har and when I fire up the recorder and switch to HAR Converter, when I browse, I cannot select any files, and selecting a directory fails when I press ‘Start !’. I’m on Mac OS X 10.8.4; java is as detailed below.

java version “1.6.0_51”
Java™ SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot™ 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Any ideas? Additional details provided once you tell me what they are. Thanks!

I can reproduce with JDK6. It works well with JDK7.

I hadn’t tested it with a JDK6 when I refactored the Recorder.
AWT’s native FileDialog is a bit broken with JDK7, but it simply doesn’t work with JDK6…
However, it looks like Swing’s FileChooser works fine on both JDKs.
We were switching to FileDialog on Mac when FileChooser was broken but now it’s the other way around !
I’ll fix it ASAP but, as a temporary fix, you can :

  • use Oracle’s JDK7
  • As we’re looking at system properties to know if the Recorder’s running on a Mac, you can trick it into thinking it’s not a Mac, by launching the Recorder with the following argument : -Dos.name=Win



Thanks for the speedy response! I can now pick files to my heart’s content. When I try to run ‘Start !’ against them, I get a ‘Export to HAR file unsuccessful’ and it tells me to look at the log files. I looked both under the application directory and in /var/log and nothing jumped out at me in the gatling-recorder source. Where might I find this next level of detail? Thanks again.


I noticed that I log the stack trace with a DEBUG level, which is not the exactly the best logging level for errors…
I’ll change it too :wink:
Currently, you have to lower the debug level : in logback.xml, in the last block (…), replace WARN by DEBUG, the stack trace will show up in the console.



I’m getting a file not found exception, which is odd, because I just selected the file in the file chooser…

13:24:56.354 [DEBUG] i.g.r.c.RecorderController - Error while processing HAR file
java.io.FileNotFoundException: /Users/jonathan/Desktop/landingPage.har (No such file or directory)
at java.io.FileInputStream.open(Native Method) ~[na:1.6.0_51]
at java.io.FileInputStream.(FileInputStream.java:120) ~[na:1.6.0_51]
at scala.io.Source$.fromFile(Source.scala:90) ~[scala-library-2.10.2.jar:na]
at scala.io.Source$.fromFile(Source.scala:75) ~[scala-library-2.10.2.jar:na]
at scala.io.Source$.fromFile(Source.scala:53) ~[scala-library-2.10.2.jar:na]
at io.gatling.recorder.har.HarReader$.processHarFile(HarReader.scala:44) ~[gatling-recorder-2.0.0-M3.jar:na]
at io.gatling.recorder.controller.RecorderController.startRecording(RecorderController.scala:72) ~[gatling-recorder-2.0.0-M3.jar:na]
at io.gatling.recorder.ui.RecorderFrontend.startRecording(RecorderFrontEnd.scala:68) [gatling-recorder-2.0.0-M3.jar:na]
at io.gatling.recorder.ui.swing.frame.ConfigurationFrame.io$gatling$recorder$ui$swing$frame$ConfigurationFrame$$reloadConfigurationAndStart(ConfigurationFrame.scala:387) [gatling-recorder-2.0.0-M3.jar:na]
at io.gatling.recorder.ui.swing.frame.ConfigurationFrame$$anonfun$8.apply$mcV$sp(ConfigurationFrame.scala:86) [gatling-recorder-2.0.0-M3.jar:na]
at scala.swing.Action$$anon$2.apply(Action.scala:60) [scala-swing-2.10.2.jar:na]
at scala.swing.Action$$anon$1.actionPerformed(Action.scala:78) [scala-swing-2.10.2.jar:na]
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028) [na:1.6.0_51]
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351) [na:1.6.0_51]
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) [na:1.6.0_51]
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) [na:1.6.0_51]
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) [na:1.6.0_51]
at java.awt.Component.processMouseEvent(Component.java:6414) [na:1.6.0_51]
at javax.swing.JComponent.processMouseEvent(JComponent.java:3275) [na:1.6.0_51]
at java.awt.Component.processEvent(Component.java:6179) [na:1.6.0_51]
at java.awt.Container.processEvent(Container.java:2083) [na:1.6.0_51]
at java.awt.Component.dispatchEventImpl(Component.java:4776) [na:1.6.0_51]
at java.awt.Container.dispatchEventImpl(Container.java:2141) [na:1.6.0_51]
at java.awt.Component.dispatchEvent(Component.java:4604) [na:1.6.0_51]
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619) [na:1.6.0_51]
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280) [na:1.6.0_51]
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210) [na:1.6.0_51]
at java.awt.Container.dispatchEventImpl(Container.java:2127) [na:1.6.0_51]
at java.awt.Window.dispatchEventImpl(Window.java:2489) [na:1.6.0_51]
at java.awt.Component.dispatchEvent(Component.java:4604) [na:1.6.0_51]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:717) [na:1.6.0_51]
at java.awt.EventQueue.access$400(EventQueue.java:82) [na:1.6.0_51]
at java.awt.EventQueue$2.run(EventQueue.java:676) [na:1.6.0_51]
at java.awt.EventQueue$2.run(EventQueue.java:674) [na:1.6.0_51]
at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_51]
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86) [na:1.6.0_51]
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:97) [na:1.6.0_51]
at java.awt.EventQueue$3.run(EventQueue.java:690) [na:1.6.0_51]
at java.awt.EventQueue$3.run(EventQueue.java:688) [na:1.6.0_51]
at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_51]
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86) [na:1.6.0_51]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:687) [na:1.6.0_51]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) [na:1.6.0_51]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) [na:1.6.0_51]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) [na:1.6.0_51]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) [na:1.6.0_51]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) [na:1.6.0_51]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) [na:1.6.0_51]

That’s strange, I have no trouble converting HAR files, whether I use master or 2.0.0-M3…

Can I email you a ZIP file to convert for me? Only partly joking :slight_smile: .

No problem :wink:
Here’s my email address: pdalpra at excilys dot com

Did you use the trick Pierre suggested (forcing the os.name System prop)? I’m not sure that would be a good idea, might mess with other stuffs such as file separator. That would explain your FNFE.

FYI, I’ve opened an issue: https://github.com/excilys/gatling/issues/1291

Thank you. (I did try the different OS trick, which led to a parsing issue that Pierre is looking into.)


The parsing error has been fixed on master : https://github.com/excilys/gatling/commit/62415adbb872a3f0129a9cd9145fb4b2c6f22250
It came from one of the POST requests in your HAR file, which had no postData block, which led to an empty iterator, throwing an exception.

However, I’m still working on a clean fix for the FileNotFound exception.

I can prepare a bundle with the fix if you like :wink:



That would be most excellent! Many thanks.

Here it is : https://docs.google.com/file/d/0B6_4DxjhiwVsczVLTThjWC1jRkE/edit?usp=sharing

Would it be possible to provide this as a one-off version as well, like I’ve seen Stephane do from time to time? That would be very helpful. Thanks.