I would like to initialize a bean having the following property:



private Iterable<Map.Entry<String, String>> groupToAuthorityMappings;


In my context.xml, I expected to do it this way:



<beans:map>
<beans:entry key="Manager">
<beans:list>
<beans:value>ROLE_ADMINISTRATOR</beans:value>
<beans:value>ROLE_USER</beans:value>
</beans:list>
</beans:entry>
</beans:map>


But I get the following error:



java.lang.IllegalStateException: Cannot convert value of type [java.util.LinkedHashMap] to required type [java.lang.Iterable] for property 'groupToAuthorityMappings': no matching editors or conversion strategy found


I cannot change the bean since it comes from a provided library. Does anybody know how I can achieve my goal?


Thanks!


No comments:

Post a Comment