File is not a normal file

2,014 views
Skip to first unread message

Emmanuel Hugonnet

unread,
Jun 22, 2012, 10:55:20 AM6/22/12
to gat...@googlegroups.com
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.<init>(FilePartSource.java:53) ~[async-http-client-1.7.5.jar:na]
        at com.ning.http.multipart.FilePart.<init>(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

Nicolas Rémond

unread,
Jun 22, 2012, 12:39:47 PM6/22/12
to gat...@googlegroups.com
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

Emmanuel Hugonnet

unread,
Jun 25, 2012, 2:35:04 AM6/25/12
to gat...@googlegroups.com
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

Stéphane Landelle

unread,
Jun 25, 2012, 3:28:18 AM6/25/12
to gat...@googlegroups.com
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.

Cheers,

Stephane

2012/6/25 Emmanuel Hugonnet <emmanuel...@gmail.com>

Emmanuel Hugonnet

unread,
Jun 25, 2012, 8:42:53 AM6/25/12
to gat...@googlegroups.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,


Le lundi 25 juin 2012 09:28:18 UTC+2, Stéphane Landelle a écrit :
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.

Cheers,

Stephane

2012/6/25 Emmanuel Hugonnet
Hi,

Stéphane Landelle

unread,
Jun 25, 2012, 8:56:28 AM6/25/12
to gat...@googlegroups.com
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:

Please let us know if it works now.
Cheers,

Steph

2012/6/25 Emmanuel Hugonnet <emmanuel...@gmail.com>
328.png

Emmanuel Hugonnet

unread,
Jun 27, 2012, 9:46:04 AM6/27/12
to gat...@googlegroups.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

Stéphane Landelle

unread,
Jun 27, 2012, 11:24:31 AM6/27/12
to gat...@googlegroups.com
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...@gmail.com>

Stéphane Landelle

unread,
Jun 27, 2012, 4:09:08 PM6/27/12
to gat...@googlegroups.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 <slan...@excilys.com>

Stéphane Landelle

unread,
Jun 27, 2012, 4:11:05 PM6/27/12
to gat...@googlegroups.com
I meant -XX:+CMSClassUnloadingEnabled, sorry!

2012/6/27 Stéphane Landelle <slan...@excilys.com>
Reply all
Reply to author
Forward
0 new messages