Hi everyone
I wasn't able to solve my problem with any hints I found in the internet, please tell me if this questions has already been answered somewhere else.
Now the question: I would like to specify different database URL, user name and password for the CI server and the IDE. I put the database.properties file on Subversion and created a second one, database.personal.properites, to store my local settings. How can I tell Spring Roo to use database.personal.properties if available and database.properties otherwise?
Here is what I've modified already:
Excerpt from applicationContext.xml:
I should add that the application skeleton was working before on the CI server.Code:<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSourceCI"> <property name="driverClassName" value="${database.driverClassName}"/> <property name="url" value="${database.url}"/> <property name="username" value="${database.username}"/> <property name="password" value="${database.password}"/> <property name="testOnBorrow" value="true"/> <property name="testOnReturn" value="true"/> <property name="testWhileIdle" value="true"/> <property name="timeBetweenEvictionRunsMillis" value="1800000"/> <property name="numTestsPerEvictionRun" value="3"/> <property name="minEvictableIdleTimeMillis" value="1800000"/> <property name="validationQuery" value="SELECT 1"/> </bean> <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSourcePersonal"> <property name="driverClassName" value="${database.driverClassName}"/> <property name="url" value="${database.personal.url}"/> <property name="username" value="${database.personal.username}"/> <property name="password" value="${database.personal.password}"/> <property name="testOnBorrow" value="true"/> <property name="testOnReturn" value="true"/> <property name="testWhileIdle" value="true"/> <property name="timeBetweenEvictionRunsMillis" value="1800000"/> <property name="numTestsPerEvictionRun" value="3"/> <property name="minEvictableIdleTimeMillis" value="1800000"/> <property name="validationQuery" value="SELECT 1"/> </bean> <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManagerCI"> <property name="entityManagerFactory" ref="entityManagerFactoryCI"/> </bean> <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManagerPersonal"> <property name="entityManagerFactory" ref="entityManagerFactoryPersonal"/> </bean> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManagerCI"/> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManagerPersonal"/> <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactoryCI"> <property name="persistenceUnitName" value="persistenceUnit"/> <property name="dataSource" ref="dataSourceCI"/> </bean> <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactoryPersonal"> <property name="persistenceUnitName" value="persistenceUnit"/> <property name="dataSource" ref="dataSourcePersonal"/> </bean>
Thanks for your help!
Paul


Reply With Quote
