Hello, Issue https://issues.apache.org/bugzilla/show_bug.cgi?id=52897 you opened is now fixed in nightly build.
- http://jmeter.apache.org/nightly.html It would be nice from you to check that fix is OK for you and comment the bug. Thanks Regards Philippe M. http://www.ubik-ingenierie.com On Tue, Mar 13, 2012 at 1:53 PM, Philippe Mouawad < [email protected]> wrote: > Hello, > I think there is an issue. > I suggest that you open a Bug attaching your test plan > > Regards > Philippe M. > http://www.ubik-ingenierie.com > > > On Tue, Mar 13, 2012 at 8:48 AM, Joe McCall < > [email protected]> wrote: > >> I wanted to confirm this behavior before filing a bug report. I'm >> running JMeter 2.6 on Windows 7 x64. My service accepts a PUT request >> with a file as the body. According to the documentation this is >> accomplished by setting up an HTTP Sampler with no parameters and one >> unnamed file to include with the request. >> >> When I run this however I get a NullPointerException: >> >> java.lang.NullPointerException: charsetName at >> java.lang.String.<init>(Unknown Source) at >> java.lang.String.<init>(Unknown Source) at >> >> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendPutData(HTTPHC4Impl.java:1067) >> at >> org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:274) >> at >> org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62) >> at >> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1054) >> at >> org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1043) >> at >> org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416) >> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271) >> at java.lang.Thread.run(Unknown Source) >> >> After some searching to no avail I checked out the source code and >> added some logging. The error occurs in HTTPHC4Impl.java: >> >> // If the request entity is repeatable, we can send it first to >> // our own stream, so we can return it >> if(put.getEntity().isRepeatable()) { >> ByteArrayOutputStream bos = new ByteArrayOutputStream(); >> put.getEntity().writeTo(bos); >> bos.flush(); >> // We get the posted bytes using the charset that was >> used to create them >> putBody.append(new String(bos.toByteArray(), >> (String) >> putParams.getParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET))); >> bos.close(); >> } >> >> getParameter() is being called on a parameter that is only set if >> getSendParameterValuesAsPostBody() is true. I copy/pasted that section >> of code into the if statement above (if (!hasArguments() && >> getSendFileAsPostBody()) and ran the build. It seemed to work fine as >> long as I specified a content-encoding (in my case, UTF-8). >> >> I can submit a patch if requested, but be warned I'm not really up to >> date with the coding standards used in apache projects. >> >> Thanks for your consideration! >> >> Joe >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > Cordialement. > Philippe Mouawad. > > > > -- Cordialement. Philippe Mouawad.
