Hi All!!!!
I need help....
I configured a spring 2.5 bean that obtain properties from db!
Today I change my spring version: from 2.5 to 3.0.5 but I'm receiving an exception:
My beans:Code:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goWebPropertiesFromDB' defined in ServletContext resource [/WEB-INF/spring-properties-from-db-context.xml]: Cannot resolve reference to bean 'goWebCommonsConfigurationFactoryBean' while setting bean property 'properties'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springmodules.commons.configuration.CommonsConfigurationFactoryBean] for bean with name 'goWebCommonsConfigurationFactoryBean' defined in ServletContext resource [/WEB-INF/spring-properties-from-db-context.xml]; nested exception is java.lang.ClassNotFoundException: org.springmodules.commons.configuration.CommonsConfigurationFactoryBean
So....which is the correct configuration in spring 3?Code:<!-- PROPERTIES BEAN FROM DB --> <bean id="goWebPropertiesFromDB" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="properties" ref="goWebCommonsConfigurationFactoryBean" /> </bean> <bean class="it.niuma.goWeb.goWebOrderedPropertyPlaceholderConfigurer.GOWebOrderedPropertyPlaceholderConfigurer"> <constructor-arg ref="goWebPropertiesFromDB" /> </bean> <bean name="goWebCommonsConfigurationFactoryBean" class="org.springmodules.commons.configuration.CommonsConfigurationFactoryBean"> <constructor-arg ref="goWebDatabaseConfiguration"/> </bean> <bean name="goWebDatabaseConfiguration" class="org.apache.commons.configuration.DatabaseConfiguration"> <constructor-arg> <bean id="ds1" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" > <value>${database.driver}</value> </property> <property name="url"> <value>${database.url}</value> </property> <property name="username"> <value>${database.user}</value> </property> <property name="password"> <value>${database.password}</value> </property> </bean> </constructor-arg> <constructor-arg index="1" value="UTENTERFX.RFX_PROPERTIES_TABLE"/> <constructor-arg index="2" value="PROPERTY_KEY"/> <constructor-arg index="3" value="PROPERTY_VALUE"/> </bean>
Thanks in advance for suggestions!
Have a nice week end!
Cheers, Vale


Reply With Quote