-
Notifications
You must be signed in to change notification settings - Fork 38k
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
Conversion service in Spring 3.1 removes items from Lists in Maps causing Spring Security exceptions [SPR-8364] #13011
Comments
Keith Donald commented Phil, is this something that just started happening in a recent snapshot, or has happened since you upgraded to 3.1? Is it reproducible in 3.1 M1 as well? |
!!Use pwebb rather than philw commented This is the first time that I have tried 3.1 but the test above fails against M1 as well. Looking though the logs my guess is something around the commits that happened early Jan could be to blame. Surprised that nobody else has hit this in though as I am working with a MVC app based on the booking-faces webflow example. |
!!Use pwebb rather than philw commented Here is a stacktrace from the web-app against 3.1.0.M1
|
Keith Donald commented It's likely this problem only shows up when a default "conversionService" bean is configured in the context. In my app, the Spring MVC conversion service is named "webMvcConversionService", so the container doesn't use it (and doesn't use a ConversionService for bean configuration at all, then). There's definitely a bug though. The MapToMapConverter is asking the service to convert a List to an Object, because target generic information is not available, and yes the CollectionToObject converter is treating the target as a scalar and extracting the list's first element. |
!!Use pwebb rather than philw commented Whilst you are in the code any chance of considering #12253 & #12252, both have patches attached. #12253 would be particularly useful for me. |
Keith Donald commented Phil, |
!!Use pwebb rather than philw commented It is indeed fixed. Thanks Keith!
|
!!Use pwebb rather than philw opened SPR-8364 and commented
Using the latest snapshot build of Spring 3.1 an IllegalArgumentException is thrown from Spring Security FilterChainProxy.checkContents.
After a bit of hunting I believe that this is due to an error in the converter service. The conversion services is being invoked to convert Map<String,List<Filter>> to Map<Object,Object>, this invokes the MapToMapConverter for the Map and then the CollectionToObjectConverter. The collection to object converter returns the 1st item in the list and discards the rest.
Here is a test case that you can use to verify. This will pass on 3.0.5 and fail on 3.1.0.BUILD-SNAPSHOT
Affects: 3.1 M1
Referenced from: commits 4d6a584, 7430fcd
The text was updated successfully, but these errors were encountered: