I have an application that is being developed that utilizes several other components. Some using Spring and Hibernate. What I want to be able to do is create a top level context for the application that contains things such as the session factory and txn proxy template. For the components they will just have thier bean definitions etc. But I want the components to be able to use the session factory and txn template declared in the application context. My understanding is that I can do so by declaring aliases on the factory and template thru the use of the names attr. Those alias names would be how the components would refrence them. From what I read and infer from Java doc etc., this should work fine. But instead I am getting a NoSuchBeanDefinitionException when the reference to the alias is used.
Here is my app context...
Here is my context for the component or child context
<bean id="ics.eBillDS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<bean id="ics.propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<bean id="ics.sessionFactory" name="ebill.sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<bean id="ics.transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<ref local="ics.sessionFactory" />
<bean id="ics.txProxyTemplate" name="ebill.txProxyTemplate" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<ref local="ics.transactionManager" />
The alias on the txProxyTemplate matches the parent id on the testDelegate bean. Is this a case where you don't have a choice when using the parent attr?
<bean id="ebill.testDelegate" parent="ebill.txProxyTemplate">
<bean id="ebill.testDAOTarget" class="com.amfam.ics.common.service.test.TestDelegate" />
I know this should be simple, so I've got to be missing something here. If not, how are others doing this type of configuration of components.