Skip to content

Multiple PropertyPlaceholderConfigurers fail in AbstractObjectFactory #120

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

Merged
merged 2 commits into from
Nov 22, 2015

Conversation

thorstenbaek
Copy link
Contributor

We discovered a possible bug in AbstractObjectFactory when upgrading from Spring.Net 1.3.1 to 2.0.0
Our usage of multiple PropertyPlaceholderConfigurers in different context files failed with the following error:
Spring.Objects.ObjectsException : Errored while postprocessing an object factory. ----> System.InvalidOperationException : Failed to compare two elements in the array. ----> System.ArgumentException : At least one object must implement IComparable.

The IOrder interface implemented in PPC is not used and IComparable is not implemented leading to this error. Adding a OrderComparer to the SortedSet constructor fixes this problem.

I added a new test to PropertyPlaceholderConfigurerTests which reproduces this error.

best regards
Thor Stenbæk

@thorstenbaek thorstenbaek changed the title Added OrderComparer to embeddedValueResolvers SortedSet Multiple PropertyPlaceholderConfigurers fail in AbstractObjectFactory Jul 22, 2015
@thorstenbaek
Copy link
Contributor Author

Changed OrderComparer to ObjectOrderComparer. After digging more into the code I discovered that the PPCs are wrapped in adapters not implementing IOrder before beeing added to the SortedSet.

sbohlen added a commit that referenced this pull request Nov 22, 2015
Multiple PropertyPlaceholderConfigurers fail in AbstractObjectFactory
@sbohlen sbohlen merged commit 2794e1c into spring-projects:master Nov 22, 2015
@gusarov
Copy link

gusarov commented Nov 3, 2017

@sbohlen, sorry but 2.0.1 (April 2015) is still the latest version on NuGet. Is that fix supposed to be released? I Just upgraded my huge production project to 2.0.1 and got the same issue.

@rmszc81
Copy link

rmszc81 commented Mar 20, 2019

@sbohlen, sorry but 2.0.1 (April 2015) is still the latest version on NuGet. Is that fix supposed to be released? I Just upgraded my huge production project to 2.0.1 and got the same issue.

any news about this package? I have the same issue, I'm trying to build the source code at this point with vs2015 and Win10 with no success.

@rmszc81 rmszc81 mentioned this pull request Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants