Grails

URL Mappings strange bug - 404 obtained when it should not - too many mappings?

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0.3
  • Fix Version/s: 1.0.4
  • Component/s: Configuration
  • Labels:
    None

Description

See attached sample app. According to the URLMappings file, specifying an URL of

http://localhost:8080/sample-urlmappings/fr/main/

should work perfectly well (it matches the third rule of the URLMappings file). Instead it produces a 404.

Now what's strange is that removing any mapping in the configuration file solves the problem. Even mappings that have absolutely nothing to do with this such as the 500 HTTP mapping. It just seems like there is a limit to the number of mappings and if you reach that limit, it produces 404 for valid URLs.

Really strange bug... but reproducable so should be quite easy to fix

Activity

Hide
Jean-Noël Rivasseau added a comment -

Patch adding the test (that would currently fail).

Show
Jean-Noël Rivasseau added a comment - Patch adding the test (that would currently fail).
Hide
Jean-Noël Rivasseau added a comment -

Patch to make the test pass (and fix this bug). The patch is probably not the best way to solve the bug (from a performance point of view), as we keep a copy of the initial parameters and reset the params map to the original value everytime. Maybe Graeme can come with something better.

Show
Jean-Noël Rivasseau added a comment - Patch to make the test pass (and fix this bug). The patch is probably not the best way to solve the bug (from a performance point of view), as we keep a copy of the initial parameters and reset the params map to the original value everytime. Maybe Graeme can come with something better.
Hide
Jean-Noël Rivasseau added a comment -

Added two patches (one is for updating the tests, the other is a potential fix). Note that the original uploaded sample-app did not actually reproduce the problem (you would need to install the searchable plugin to get it to reproduce).

Much better to use the new test to look at the problem.

Show
Jean-Noël Rivasseau added a comment - Added two patches (one is for updating the tests, the other is a potential fix). Note that the original uploaded sample-app did not actually reproduce the problem (you would need to install the searchable plugin to get it to reproduce). Much better to use the new test to look at the problem.
Hide
Peter Ledbrook added a comment -

There's no real alternative to copying the original request parameters and restoring them before each info.configure(...). I have applied the patches in r7401. Thanks Jean-Noël!

I have also added a test to the Grails functional tests to check for regressions on this.

Show
Peter Ledbrook added a comment - There's no real alternative to copying the original request parameters and restoring them before each info.configure(...). I have applied the patches in r7401. Thanks Jean-Noël! I have also added a test to the Grails functional tests to check for regressions on this.
Hide
Jean-Noël Rivasseau added a comment -

Peter: you said you added a functional test, but I had included a patch for the tests as well, just to add the test for this... You did not apply the test patch?

Thanks for applying the fix patch.

Show
Jean-Noël Rivasseau added a comment - Peter: you said you added a functional test, but I had included a patch for the tests as well, just to add the test for this... You did not apply the test patch? Thanks for applying the fix patch.
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: