-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Bean injection fails due to nullSafeConciseToString()
invoking isEmpty()
on a Map
/Collection
proxy
#31138
Comments
Please provide a sample, minimal application that reproduces this problem. |
I came across the same issue on my Spring based project I think the stacktrace of .27 vs .29 is a good indicator of the root cause as you can see below (for the same project, just different spring core version). On core 5.3.27, the exception is logged only in DEBUG mode, as it is handled by Spring :
On 5.3.29, the exception is fatal and breaks the context initialization:
Looks like the error on 5.3.29 breaks the context initialization because when instantiating a new It looks like this change is related to the commit : a3907a6 |
@mohlam12 let's not jump to conclusions before we had a chance to look at the problem. Do you have a minimal sample application you can share with us? |
Sorry but that was not my intention. My previous comment does not have a conclusion, just an opinion and a commit that looks to be related to the same class that causes the exception according to the stacktrace since 5.3.29 |
I can see a potential regression here indeed for lazy beans of type |
I agree. I've put some thought into it, and here are a few brainstorming ideas.
Though, the latter might only be applicable for Additional ideas are welcome. As a side note, it might be a good idea to implement |
I may have stumbled upon a similar problem in a SAP Commerce project. In versuon 2211.10 SAP upgraded spring from 5.3.27 to 5.3.29. I see the same behaviour. In my case I'm having issues with a list of beans, that implement a certain interface:
Beans injecting the list defaultAdapters fail to create an instance in 5.3.29, which was working in 5.3.27:
[...]
I'd be happy to test any potential fix. |
Hi @lennartjuette,
Yes, that is the same issue, triggered by the use of
Thanks! We'll post back here once we have a fix in place. |
nullSafeConciseToString()
invoking isEmpty()
on a Map
/Collection
nullSafeConciseToString()
invoking isEmpty()
on a Map
/Collection
nullSafeConciseToString()
invoking isEmpty()
on a Map
/Collection
proxy
This has been addressed in Please try out the upcoming snapshots and let us know if you run into any further issues. Thanks! |
Very much appreciated @sbrannen! We'll give it a shot! |
Thanks, @luisericlf. I also just noticed that this was the first issue you have created on GitHub -- "(their first ever)" as GitHub phrases it. So, congratulations on that! 👍 |
Not knowing where to look i searched and stumbled upon a 5.3.30-SNAPSHOT build from 08.09.2023: https://repo.spring.io/artifactory/snapshot/org/springframework/spring/5.3.30-SNAPSHOT/spring-5.3.30-20230908.144355-28-dist.zip Using these jars worked for me on my local setup. I'd say the issue was fixed. Assuming that I picked the correct SNAPSHOT build, that is. |
That looks like it's good. FYI: documentation for how to use snapshots in your Gradle or Maven build can be found here.
Great! Thanks for trying it out and letting us know. |
I am having the exact same issue while upgrading to SAP Commerce Cloud 2211.12, the spring jars are in platform core and we cannot modify them while we are on the cloud. can you please tell me how did you replace the 5.3.29 with 5.3.27 ? Thanks. |
That's actually not a spring issue, so you should ask this in the SAP support forums. To answer your question: The jars have only been replaced manually on a local install for testing so far. I didn't bother to fiddle around with our regular builds and roll this out. You could set up a buildcallback that replace the jars, though. My solution was to pin down my project on 2211.9, until a new spring release has been released and SAP catches up with that in their next release. |
@lennartjuette |
FYI: Spring Framework 6.0.12 and 5.3.30 were both released today. |
@sbrannen |
@rafikhamid is right: As Spring is a) a dependency of SAP Commerce as platform, so it's their issue to deal with and b) it's not exactly trivial to override dependencies, they will have to fix is quickly it for the bulk of all SAP Commerce users. Thanks @sbrannen, I'll give the SAP guys a hint, so they can test this and pull the new Spring jars into their release. Hopefully you'll don't have to deal with any more of us SAP CC devs here ;) Thanks for the support! |
I have two beans like this:
Please note: ProblematicInnerClass1 and ProblematicInnerClass2 are static inner classes inside of ProblematicClass that extend from ProblematicClass.
When I try to start the context, spring throws the following summarized error:
Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'jdk.proxy4.$Proxy363 implementing java.util.List' to required type 'java.util.List' for property 'strategies'; nested exception is java.lang.IllegalStateException: Singleton instance not initialized yet
Note: This works fine with 5.3.27 but fails with 5.3.29, we noticed that some changes were made to ObjectUtils.nullSafeConciseToString, which is part of the stack trace.
This is the stacktrace that contains the reference to ObjectUtils.nullSafeConciseToString
The text was updated successfully, but these errors were encountered: