try
Code:
beanReader.loadBeanDefinitions(resource);
param.setLovResolver((LOVResolver)beanFactory.getBean("config"));
The properties file is parsed with this method (from PropertiesBeanDefinitionReader).
Code:
/**
* Register bean definitions contained in a Map.
* Ignore ineligible properties.
* @param map Map name -> property (String or Object). Property values
* will be strings if coming from a Properties file etc. Property names
* (keys) <b>must</b> be strings. Class keys must be Strings.
* @param prefix match or filter within the keys in the map: e.g. 'beans.'
* (can be empty or <code>null</code>)
* @param resourceDescription description of the resource that the Map came from
* (for logging purposes)
* @return the number of bean definitions found
* @throws BeansException in case of loading or parsing errors
* @see #registerBeanDefinitions(Map, String)
*/
public int registerBeanDefinitions(Map map, String prefix, String resourceDescription)
throws BeansException {
if (prefix == null) {
prefix = "";
}
int beanCount = 0;
for (Iterator it = map.keySet().iterator(); it.hasNext();) {
Object key = it.next();
if (!(key instanceof String)) {
throw new IllegalArgumentException("Illegal key [" + key + "]: only Strings allowed");
}
String keyString = (String) key;
if (keyString.startsWith(prefix)) {
// Key is of form: prefix<name>.property
String nameAndProperty = keyString.substring(prefix.length());
// Find dot before property name, ignoring dots in property keys.
int sepIdx = -1;
int propKeyIdx = nameAndProperty.indexOf(PropertyAccessor.PROPERTY_KEY_PREFIX);
if (propKeyIdx != -1) {
sepIdx = nameAndProperty.lastIndexOf(SEPARATOR, propKeyIdx);
}
else {
sepIdx = nameAndProperty.lastIndexOf(SEPARATOR);
}
if (sepIdx != -1) {
String beanName = nameAndProperty.substring(0, sepIdx);
if (logger.isDebugEnabled()) {
logger.debug("Found bean name '" + beanName + "'");
}
if (!getBeanFactory().containsBeanDefinition(beanName)) {
// If we haven't already registered it...
registerBeanDefinition(beanName, map, prefix + beanName, resourceDescription);
++beanCount;
}
}
else {
// Ignore it: It wasn't a valid bean name and property,
// although it did start with the required prefix.
if (logger.isDebugEnabled()) {
logger.debug("Invalid bean name and property [" + nameAndProperty + "]");
}
}
}
}
return beanCount;
}
So it is checking for properties starting with prefix, stripping the prefix, letting only the .(class) reside, which leaves a bean definition without a beanname.