Hi all!
I'm migrating my web app from JSF 1.x and Spring 2.5 to JSF 2 and Spring 3.0.5
I load properties from DB and file.
I have this configuration for Spring 2.5:
applicaztion-context.xml
GOWebOrderedPropertyPlaceholderConfigurer.javaCode:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <!-- 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> <!-- PROPERTIES BEAN FROM FILE --> <bean id="goWebPropertiesFromFile" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="true"/> <property name="location" value="classpath:GOWeb.properties"/> </bean> </beans>
I changed spring jars and I have some problems because Ordered, ConfigurableListableBeanFactory, PropertyPlaceholderConfigurer, etc are not founded.Code:package it.niuma.goWeb.goWebOrderedPropertyPlaceholderConfigurer; import java.util.Properties; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.core.Ordered; public class GOWebOrderedPropertyPlaceholderConfigurer implements Ordered, BeanFactoryPostProcessor { private Properties properties; private int order = 0; public GOWebOrderedPropertyPlaceholderConfigurer(Properties properties) { this.properties = properties; } public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { PropertyPlaceholderConfigurer bfPostProcessor = new PropertyPlaceholderConfigurer(); bfPostProcessor.setProperties(properties); bfPostProcessor.postProcessBeanFactory(beanFactory); } public int getOrder() { return order; } public void setOrder(int order) { this.order = order; } }
I searched the solution on internet and spring documentation but, at this time, I'm so confused
Can anyone help me, please?
Thanks in advance for any suggestions!!!!
Cheers, Valentina



Reply With Quote
).

