Hi,
Iam trying to upload a file using Gatling but I don"t want to use the request stored in a file but the upload(file: File, mimeType: String, charset: String).
I get an error :
java.io.FileNotFoundException: File is not a normal file.
at com.ning.http.multipart.FilePartSource.(FilePartSource.java:53) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.multipart.FilePart.(FilePart.java:124) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.util.AsyncHttpProviderUtils.createMultipartRequestEntity(AsyncHttpProviderUtils.java:262) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.construct(NettyAsyncHttpProvider.java:784) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.buildRequest(NettyAsyncHttpProvider.java:539) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.providers.netty.NettyConnectListener$Builder.build(NettyConnectListener.java:140) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:970) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:858) ~[async-http-client-1.7.5.jar:na]
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:512) ~[async-http-client-1.7.5.jar:na]
at com.excilys.ebi.gatling.http.action.HttpRequestAction.execute(HttpRequestAction.scala:112) ~[gatling-http-1.2.3.jar:na]
I put the file in the user-files/request-bodies/MyFile as per the documentation.
With the error I just can’t think of what I have done wrong.
Emmanuel
It throws this exception when the path is pointing to anything else than a file : a folder, a symlink etc.
How are you using it?
cheers
nicolas
Hi,
I don’t provide a path, using only the file name as it is in $GATLING_HOME/user-files/request-bodies/
It is a ‘pure’ docx file. I wanted to be able to run the load from different computers thus I couldn’t provide an absolute path.
Emmanuel
Hi,
Very strange.
Nicolas a reimplemented our CookieStore, now it’s way cleaner, and I’ve added some logs that would help us understand what happens.
Could you try this snapshot, please?
https://github.com/downloads/excilys/gatling/gatling-charts-highcharts-1.2.4-SNAPSHOT-bundle.zip
Cheers,
Stephane
2012/6/25 Emmanuel Hugonnet <emmanuel.hugonnet@gmail.com>
Hi,
Not working :
Exception in thread “main” java.lang.IllegalArgumentException: Uploaded file /home/ehugonnet/programs/gatling-charts-highcharts-1.2.4-SNAPSHOT/user-files/request-bodies/application/vnd.openxmlformats-officedocument.wordprocessingml.document does not exist
at com.excilys.ebi.gatling.http.request.builder.UploadedFile$.apply(UploadedFile.scala:31)
at com.excilys.ebi.gatling.http.request.builder.AbstractHttpRequestWithBodyAndParamsBuilder.upload(AbstractHttpRequestWithBodyAndParamsBuilder.scala:110)
at com.silverpeas.customers.inra.SimulationCreationPublication.apply(SimulationCreationPublication.scala:700)
at com.silverpeas.customers.inra.SimulationCreationPublication.apply(SimulationCreationPublication.scala:11)
Offending code :
.upload(""“ScenariiAudit.docx”"",
“”“application/vnd.openxmlformats-officedocument.wordprocessingml.document”"",""“UTF-8"”")
Cheers,
OK, so now it’s very clear! 
The signature of the upload method is actually:
upload(httpParameterName, fileName, mimeType, charset)
with mimeType defaulting to application/octet-stream and charset defaulting to the one configured in gatling.conf
This was an old pull request where the httpParameterName could not be set and was automatically configured with the fileName, and we forgot to update the doc.
The doc is correct now:
https://github.com/excilys/gatling/wiki/HTTP#wiki-multipart
Please let us know if it works now.
Cheers,
Steph
2012/6/25 Emmanuel Hugonnet <emmanuel.hugonnet@gmail.com>
Seems to be wroking now but I’m getting out of memory errors in the permgen.
No time to investigate more before end of the week.
I will keep you informed.
Cheers,
Emmanuel
Permgen?! This is a first.
Would be interested in how your scenario works. Feel free to PM me if you think I can help but don’t want to post your scenario on the mailing list.
Steph
2012/6/27 Emmanuel Hugonnet <emmanuel.hugonnet@gmail.com>
-XX:+CMSParallelRemarkEnabled option should probably be added in gatling.sh/bat script. Will be in 1.2.4.
Steph
2012/6/27 Stéphane Landelle <slandelle@excilys.com>
I meant -XX:+CMSClassUnloadingEnabled, sorry!
2012/6/27 Stéphane Landelle <slandelle@excilys.com>