Hi,
I am new to Spring and am having difficulties with the applicationContext-hibernate.xml file. When I setup 2 bean objects everything works fine, but when I add a third one, the HashMap definitions for the XmlWebApplicationContext beanFactory's beanDefinitionMap get all mixed-up with certain entries being missing. I was able to variate the problem somehow by changing the names of the services and targets in the definitions which leads me to believe that the issue is with the unique id's being hashed incorrectly. I am including the relevant section from the configuration file for reference.
All help is greatly appreciated.Code:<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) --> <bean id="someTransactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> <property name="sessionFactory"><ref local="someSessionFactory"/></property> </bean> <!-- ***** LOGIN SERVICE ***** --> <bean id="loginService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref local="someTransactionManager"/></property> <property name="target"><ref local="userLoginTarget"/></property> <property name="transactionAttributes"> <props> <prop key="find*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> <prop key="save*">PROPAGATION_REQUIRED,-LoginException</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> </props> </property> </bean> <!-- ***** LOOKUP SERVICE ***** --> <bean id="lookupTableService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref local="someTransactionManager"/></property> <property name="target"><ref local="lookupTableTarget"/></property> <property name="transactionAttributes"> <props> <prop key="find*">PROPAGATION_REQUIRED,readOnly,-RecordNotFoundException</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly,-RecordNotFoundException</prop> <prop key="save*">PROPAGATION_REQUIRED,-DatabaseException</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly,-DatabaseException</prop> </props> </property> </bean> <!-- ***** MEMBERSHIP SERVICE ***** --> <bean id="memberService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref local="someTransactionManager"/></property> <property name="target"><ref local="memberTarget"/></property> <property name="transactionAttributes"> <props> <prop key="find*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> <prop key="save*">PROPAGATION_REQUIRED,-LoginException</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly,-LoginException</prop> </props> </property> </bean> <!-- LoginTarget primary business object implementation --> <bean id="userLoginTarget" class="com.name.service.spring.LoginServiceSpringImpl"> <property name="userDAO"><ref local="userDAO"/></property> </bean> <!-- LookupTarget primary business object implementation --> <bean id="lookupTableTarget" class="com.name.service.spring.LookupServiceSpringImpl"> <property name="lookupTableDAO"><ref local="lookupTableDAO"/></property> </bean> <!-- MemberTarget primary business object implementation --> <bean id="memberTarget" class="com.name.service.spring.MemberServiceSpringImpl"> <property name="memberDAO"><ref local="memberDAO"/></property> </bean> <!-- DAO object: Hibernate implementation --> <bean id="userDAO" class="com.name.hibernate.dao.UserHibernateDAO"> <property name="sessionFactory"><ref local="someSessionFactory"/></property> </bean> <!-- DAO object: Hibernate implementation --> <bean id="lookupTableDAO" class="com.name.hibernate.dao.LookupHibernateDAO"> <property name="sessionFactory"><ref local="someSessionFactory"/></property> </bean> <bean id="memberDAO" class="com.name.hibernate.dao.MemberHibernateDAO"> <property name="sessionFactory"><ref local="someSessionFactory"/></property> </bean>
Thanks in advance,
- Paul


Reply With Quote