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
PropertyPlaceholderConfigurer doesn't replace placeholders in map element bean reference [SPR-4846] #9522
Comments
Sergey Ponomarev commented stacktrace: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '${namespace}.myBean' is defined |
Sergey Ponomarev commented Found error. I think this is an error, as code in BeanDefinitionVisitor.visitMap expects argument to be unchanged |
Sergey Ponomarev commented Corrected TypedStringValue resolving |
Juergen Hoeller commented I've fixed this in a slightly different fashion: PropertyPlaceholderConfigurer correctly manages resolution of set entries and map keys with modified hash code now. TypedStringValues are a typical example there, but BeanDefinition objects etc would be affected as well when used as set entry or map key. As a consequence, BeanDefinitionVisitor explicitly calculates and compares hash codes now, updating the set/map content accordingly when necessary. This will be available in tonight' s 2.5.5 snapshot (http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR). Please give it an early try if you have the chance, and let us know whether it works for you! Juergen |
Sergey Ponomarev commented Test case passed. |
Sergey Ponomarev opened SPR-4846 and commented
<bean id="myBean2" class="my.PropsHolder">
<property name="props1"><map>
<!--don't work--/> <entry key="${namespace}1" value-ref="${namespace}.myBean"/>
<!--don't work--/> <entry key="${namespace}"><ref bean="${namespace}.myBean"/> </entry>
</map></property>
<property name="props2"><list>
<!--works --/> <ref bean="${namespace}.myBean"/>
</list></property>
<property name="props3"><set>
<!--works --/> <ref bean="${namespace}.myBean"/>
</set></property>
<!--works --/> <property name="bean" ref="${namespace}.myBean"/>
</bean>
Affects: 2.5.4
Attachments:
The text was updated successfully, but these errors were encountered: