Question

We're having an issue where the values that we take in via @PathVariable or via binding under moderate load are getting assigned to the wrong variables.

For doing these tests we're always hitting the same URL's. Hitting the URL's slowly produce the correct results every time.

We're using Spring 3.0.5.RELEASE but have tired up to 3.1.2.RELEASE and still have the issue. We can't see anything else that's changed lately and we've had these services in production for over a year now and they seem to have just recently started throwing these.

Code Example for Binding:

 @RequestMapping(value = "config/selectItem")
public ModelAndView selectItem(@Valid selectItemCommand command, BindingResult bindResults) {
   if (!"test".equals(command.getName())
   {
     //Fails into here
     int i =0;

   }    
}

Code Example for Path Variables:

@RequestMapping(value = "config/selectItem/{name}",method = RequestMethod.GET)
public ModelAndView selectItem(@PathVariable("name") String name)
{
  if (!"test".equals(name))
  {
    //Fails into here
    int i = 0;
  }
}

I added a HttpServletRequest request to the parameter list and the URL that it shows has the correct values.

I totally forgot but we had this come up about a year ago and I had put in a ticket at the time that I thought had resolved it but has not. Spring MVC is dropping a @PathVariable

Was it helpful?

Solution

It turns out that we implemented a StringTrimmerEditor incorrectly and it wasn't threadsafe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top