Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve ambiguous handler mapping in SeedController #579

Merged

Conversation

groldan
Copy link
Member

@groldan groldan commented Dec 18, 2024

Override the @PostMapping path pattern in SeedController to exclude .xml and .json suffixes, addressing a stricter behavior in Spring Boot compared to regular Spring. This resolves a potential IllegalStateException caused by ambiguous handler methods.

  • Updated doPost endpoint path to use regex excluding .xml and .json.
  • Prevents conflicts between JSON and XML payload handlers (seedOrTruncateWithJsonPayload and seedOrTruncateWithXmlPayload).
  • Fixes mapping collision issues observed when calling endpoints like /rest/seed/workspace:layer.xml under Spring Boot.

This change ensures compatibility with Spring Boot's stricter handler mapping rules while maintaining functionality consistent with the base SeedController logic.


Fixes #502

Override the `@PostMapping` path pattern in `SeedController` to exclude `.xml`
and `.json` suffixes, addressing a stricter behavior in Spring Boot compared
to regular Spring. This resolves a potential `IllegalStateException` caused by
ambiguous handler methods.

- Updated `doPost` endpoint path to use regex excluding `.xml` and `.json`.
- Prevents conflicts between JSON and XML payload handlers (`seedOrTruncateWithJsonPayload`
  and `seedOrTruncateWithXmlPayload`).
- Fixes mapping collision issues observed when calling endpoints like
  `/rest/seed/workspace:layer.xml` under Spring Boot.

This change ensures compatibility with Spring Boot's stricter handler mapping
rules while maintaining functionality consistent with the base `SeedController` logic.
@groldan groldan merged commit cbfb60a into geoserver:main Dec 18, 2024
2 of 4 checks passed
@groldan groldan deleted the bug/gwc_rest_ambiguous_handler_method branch December 18, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambiguous Handler Methods Error When Seeding Cache Using GeoServer REST API
1 participant