On 06/09/07, Ronan Klyne <[EMAIL PROTECTED]> wrote: > sebb wrote: > > On 06/09/07, sebb <[EMAIL PROTECTED]> wrote: > >> On 06/09/07, Ronan Klyne <[EMAIL PROTECTED]> wrote: > >>> sebb wrote: > >>>> Looking further at the stack trace shows that it is caused by a > >>>> sub-sample with ResponseMessage=null. > >>>> > >>>> [I was able to reproduce this by using BeanShell sampler to create a > >>>> sample result, set the response message to null, and then add it as a > >>>> subresult to the current sample. There may situations in which JMeter > >>>> creates such subresults.] > >>>> > >>>> The XStream PrettyPrintWriter cannot handle null Strings, so I've > >>>> updated the code in SVN to convert null to the empty string. > >>>> > >>>> This will stop the NPE in future. > >>>> > >>>> Meanwhile, if you disable writing to a file, and add a Tree View > >>>> Listener (if necessary), you should be able to see which sub-sample is > >>>> at fault by checking the Sampler Result tab - it will look like: > >>>> > >>>> Response Message: null > >>>> > >>>> if the RM is null. > >>>> > >>>> It would be useful to know what this reveals. > >>> I've found such aa sample. It occurs when the server tries to redirect > >>> without returning a page, but by returning a 302 and a new path in the > >>> location header. > >>> > >>> ---- Sample Result ---- > >>> > >>> Thread Name: 5.Logins 1-1 > >>> Sample Start: 2007-09-06 07:37:33 BST > >>> Load time: 234 > >>> Size in bytes: 0 > >>> Response code: 302 > >>> Response message: null > >>> > >>> Response headers: > >>> HTTP/1.1 302 > >>> Date: Thu, 06 Sep 2007 06:39:45 GMT > >>> Server: Apache > >>> Set-Cookie: .......... > >>> Expires=Fri, 07-Sep-2007 06:39:45 GMT; > >>> Location: http://uutest.withbc.com/bc/bc.cgi > >>> Content-Length: 0 > >>> Connection: close > >>> Content-Type: text/plain; charset=ISO-8859-1 > >> Thanks, that's very useful. > >> > >> I think servers are supposed to return some text after the 302; maybe > >> that is causing the null Response Message. It won't be the lack of any > >> document contents. But I need to check if the text is required, and if > >> missing text causes the null. > > > > By the way, is it a plain HTTP Sampler, or the HTTP HTTPClient sampler? > > It's a plain HTTP Sampler.
OK - I see from the code that sometimes this can return -1 for the ResponseCode; JMeter handles this by returning the HTTP header if necessary. I'll put in a check for null ResponseMessage, and use the header for this as well. Together with the fix to XML saving, that should cover all possilities ... > # r > > -- > Ronan Klyne > Business Collaborator Developer > Tel: +44 (0)870 163 2555 > [EMAIL PROTECTED] > www.groupbc.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

