Hi Stefan,

Thanks for providing these info. I've entered a bug report to keep track of
it:
http://restlet.tigris.org/issues/show_bug.cgi?id=889

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : [email protected] [mailto:[email protected]] 
Envoyé : lundi 24 août 2009 20:47
À : [email protected]
Objet : RE: Extracting POST parameters fails sporadically

Hi Jerome,

sorry for the delay, I'm working only part time on this project. Attached is
a netbeans project and a complete .war file of the restlet, plus a JMeter
test plan.
The restlet is extremely simple, the code is just these two classes:

public class myapp extends Application
{
  @Override
  public Restlet createRoot()
  {
    Router router = new Router(getContext());
    router.attach("/resource", MyResource.class);
    return router;
  }
}

public class MyResource extends ServerResource {
  @Post
  public Representation postInfo()
  {
    Form postForm = getRequest().getEntityAsForm();
    if (postForm.size() == 0)
    {
      setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    }
    return new StringRepresentation("Parameter count: " + postForm.size() +
"\n");
  }
}



The error is pretty hard to reproduce; I've been using JMeter to send posts
to the "/resource" resource with 4 parameters, and sometimes I can send
hundreds and thousands of requests without problems. Other times up to 10%
of the requests fail with BAD_REQUEST.

I have had the impression that the error is easier to reproduce after the
tomcat server has been idle for a long time, although this doesn't seem to
make much sense.

Hope that helps...
Regards
Stefan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2386947

Reply via email to