raydawg
Mar 2nd, 2006, 12:15 PM
Hello,
My web app is going to be accessing 3 databases. So i thought that I had setup this up properly in my spring file, but when i access an action mapping, ie: test.do, an error is thrown
2006-03-02 09:25:39 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'sessionFactory' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [adminLogonDAO,adminUserDAO,advisorLogonDAO,advisor RegularHoursDAO,advisorServiceRolesDAO,advisorStat usLogDAO,advisorUserDAO,departmentDAO,frontdeskLog onDAO,frontdeskStatusLogDAO,frontdeskUserDAO,servi ceCatLookupDAO,supervisorLogonDAO,supervisorStatus LogDAO,supervisorUserDAO,systemHolidaysDAO,systemS choolYearsDAO,systemSettingsDAO,userStatusLookupDA O,advisingAppointmentsDAO,advisingSummariesDAO,adv isorProfileDAO,advisorScheduleDAO,appointmentStatu sLookupDAO,nostdAnswersDAO,nostdQuestionsDAO,stdAn swerLookupDAO,stdQuestionLookupDAO,stdQuestionsDAO ,studentLogonDAO,studentUserDAO,addAdvisingSummary SvcTarget,cancelStudentAppointmentSvcTarget,editSc heduleSvcTarget,enterStudentInformationSvcTarget,s cheduleStudentAppointmentSvcTarget,transferAnAppoi ntmentSvcTarget,veiwGroupScheduleSvcTarget,veiwStu dentHistorySvcTarget,veiwStudentInformationSvcTarg et,managerMainDataSource,advisingMainDataSource,su rveyMainDataSource,advisingSessionFactory,managerS essionFactory,surveySessionFactory,advisingTxManag er,managerTxManager,surveyTxManager,mailSender,war ehouse]; root of BeanFactory hierarchy
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:307)
at
This sounds like its saying that there must be a bean defined sessionFactory, and that I cannot use the beanId's that I used advisingSessionFactor, etc... So my question I guess is that do i have to have a bean defined sessionFactory? and if i do how would i do that so that I can use these 3 databases? I have done complete searches through my whole project and there is not any references to sessionFacotry. Below is my spring.xml file
Thanks
-Ray
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--
Reference to Manager Database DAOs config file
-->
<import resource="spring-Manager-DAOs.xml"/>
<!--
Reference to Advising Database DAOs config file
-->
<import resource="spring-Advising-DAOs.xml"/>
<!--
Reference to Advising Database DAOs config file
-->
<import resource="spring-Survey-DAOs.xml"/>
<!--
Service Layer Definitions for Advisor use cases
-->
<import resource="spring-Advisor-Services.xml"/>
[....]Database definitions[....]
<bean id="advisingSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="advisingMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Advising/AdminLogon.hbm.xml</value>
<value>/mappings/Advising/AdminUser.hbm.xml</value>
<value>/mappings/Advising/AdvisingAppointments.hbm.xml</value>
<value>/mappings/Advising/AdvisingSummaries.hbm.xml</value>
<value>/mappings/Advising/AdvisorLogon.hbm.xml</value>
<value>/mappings/Advising/AdvisorProfile.hbm.xml</value>
<value>/mappings/Advising/AdvisorUser.hbm.xml</value>
<value>/mappings/Advising/AdvisorSchedule.hbm.xml</value>
<value>/mappings/Advising/AppointmentStatusLookup.hbm.xml</value>
<value>/mappings/Advising/NostdAnswers.hbm.xml</value>
<value>/mappings/Advising/NostdQuestions.hbm.xml</value>
<value>/mappings/Advising/ScheduleCodeLookup.hbm.xml</value>
<value>/mappings/Advising/StdAnswerLookup.hbm.xml</value>
<value>/mappings/Advising/StdQuestionLookup.hbm.xml</value>
<value>/mappings/Advising/StdQuestions.hbm.xml</value>
<value>/mappings/Advising/StudentLogon.hbm.xml</value>
<value>/mappings/Advising/StudentUser.hbm.xml</value>
<value>/mappings/Advising/SupervisorLogon.hbm.xml</value>
<value>/mappings/Advising/SupervisorUser.hbm.xml</value>
</list>
</property>
</bean>
<bean id="managerSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="managerMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Manager/AdminLogon.hbm.xml</value>
<value>/mappings/Manager/AdminUser.hbm.xml</value>
<value>/mappings/Manager/AdvisorRegularHours.hbm.xml</value>
<value>/mappings/Manager/AdvisorServiceRoles.hbm.xml</value>
<value>/mappings/Manager/AdvisorStatusLog.hbm.xml</value>
<value>/mappings/Manager/AdvisorLogon.hbm.xml</value>
<value>/mappings/Manager/AdvisorUser.hbm.xml</value>
<value>/mappings/Manager/Department.hbm.xml</value>
<value>/mappings/Manager/FrontdeskLogon.hbm.xml</value>
<value>/mappings/Manager/FrontdeskStatusLog.hbm.xml</value>
<value>/mappings/Manager/FrontdeskUser.hbm.xml</value>
<value>/mappings/Manager/ServiceCatLookup.hbm.xml</value>
<value>/mappings/Manager/SupervisorLogon.hbm.xml</value>
<value>/mappings/Manager/SupervisorUser.hbm.xml</value>
<value>/mappings/Manager/SupervisorStatusLog.hbm.xml</value>
<value>/mappings/Manager/SystemHolidays.hbm.xml</value>
<value>/mappings/Manager/SystemSchoolYears.hbm.xml</value>
<value>/mappings/Manager/SystemSettings.hbm.xml</value>
<value>/mappings/Manager/UserStatusLookup.hbm.xml</value>
</list>
</property>
</bean>
<bean id="surveySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="surveyMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Survey/SurveyBasicInfo.hbm.xml</value>
</list>
</property>
</bean>
<bean id="advisingTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="advisingSessionFactory"/></property>
<property name="dataSource"><ref local="advisingMainDataSource"/></property>
</bean>
<bean id="managerTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="managerSessionFactory"/></property>
<property name="dataSource"><ref local="managerMainDataSource"/></property>
</bean>
<bean id="surveyTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="surveySessionFactory"/></property>
<property name="dataSource"><ref local="surveyMainDataSource"/></property>
</bean>
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderIm pl">
<property name="host"><value>smtp.ucr.edu</value></property>
</bean>
<!--
Create the warehouse so it will already have a connection and keep a
refernce so it won't get GC'd
-->
<bean id="warehouse"
class="org.springframework.beans.factory.config.MethodInv okingFactoryBean"
lazy-init="true">
<property name="staticMethod">
<value>edu.ucr.c3.ucrwarehouse.WarehouseFactory.createWar ehouse</value>
</property>
</bean>
<!--
Configure velocity for our e-mail templates
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFact oryBean">
<property name="velocityProperties">
<props>
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.class">
org.apache.velocity.runtime.resource.loader.Classp athResourceLoader
</prop>
</props>
</property>
</bean>
-->
<!-- define a task that will call the synchronizeData method of a service bean
to keep our data synchronized
<bean id="dataSyncJob" class="org.springframework.scheduling.quartz.MethodInvoki ngJobDetailFactoryBean">
<property name="targetObject"><ref bean="academicService"/></property>
<property name="targetMethod"><value>synchronizeData</value></property>
<property name="concurrent"><value>false</value></property>
</bean>
<bean id="dailyDataSync" class="org.springframework.scheduling.quartz.CronTriggerB ean">
<property name="jobDetail">
<ref bean="dataSyncJob"/>
</property>
<property name="cronExpression">
<value>0 0 2 * * ? </value>
</property>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFac toryBean">
<property name="triggers">
<list>
<ref local="dailyDataSync"/>
</list>
</property>
<property name="autoStartup"><value>true</value></property>
</bean> -->
</beans>
My web app is going to be accessing 3 databases. So i thought that I had setup this up properly in my spring file, but when i access an action mapping, ie: test.do, an error is thrown
2006-03-02 09:25:39 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'sessionFactory' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [adminLogonDAO,adminUserDAO,advisorLogonDAO,advisor RegularHoursDAO,advisorServiceRolesDAO,advisorStat usLogDAO,advisorUserDAO,departmentDAO,frontdeskLog onDAO,frontdeskStatusLogDAO,frontdeskUserDAO,servi ceCatLookupDAO,supervisorLogonDAO,supervisorStatus LogDAO,supervisorUserDAO,systemHolidaysDAO,systemS choolYearsDAO,systemSettingsDAO,userStatusLookupDA O,advisingAppointmentsDAO,advisingSummariesDAO,adv isorProfileDAO,advisorScheduleDAO,appointmentStatu sLookupDAO,nostdAnswersDAO,nostdQuestionsDAO,stdAn swerLookupDAO,stdQuestionLookupDAO,stdQuestionsDAO ,studentLogonDAO,studentUserDAO,addAdvisingSummary SvcTarget,cancelStudentAppointmentSvcTarget,editSc heduleSvcTarget,enterStudentInformationSvcTarget,s cheduleStudentAppointmentSvcTarget,transferAnAppoi ntmentSvcTarget,veiwGroupScheduleSvcTarget,veiwStu dentHistorySvcTarget,veiwStudentInformationSvcTarg et,managerMainDataSource,advisingMainDataSource,su rveyMainDataSource,advisingSessionFactory,managerS essionFactory,surveySessionFactory,advisingTxManag er,managerTxManager,surveyTxManager,mailSender,war ehouse]; root of BeanFactory hierarchy
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:307)
at
This sounds like its saying that there must be a bean defined sessionFactory, and that I cannot use the beanId's that I used advisingSessionFactor, etc... So my question I guess is that do i have to have a bean defined sessionFactory? and if i do how would i do that so that I can use these 3 databases? I have done complete searches through my whole project and there is not any references to sessionFacotry. Below is my spring.xml file
Thanks
-Ray
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--
Reference to Manager Database DAOs config file
-->
<import resource="spring-Manager-DAOs.xml"/>
<!--
Reference to Advising Database DAOs config file
-->
<import resource="spring-Advising-DAOs.xml"/>
<!--
Reference to Advising Database DAOs config file
-->
<import resource="spring-Survey-DAOs.xml"/>
<!--
Service Layer Definitions for Advisor use cases
-->
<import resource="spring-Advisor-Services.xml"/>
[....]Database definitions[....]
<bean id="advisingSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="advisingMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Advising/AdminLogon.hbm.xml</value>
<value>/mappings/Advising/AdminUser.hbm.xml</value>
<value>/mappings/Advising/AdvisingAppointments.hbm.xml</value>
<value>/mappings/Advising/AdvisingSummaries.hbm.xml</value>
<value>/mappings/Advising/AdvisorLogon.hbm.xml</value>
<value>/mappings/Advising/AdvisorProfile.hbm.xml</value>
<value>/mappings/Advising/AdvisorUser.hbm.xml</value>
<value>/mappings/Advising/AdvisorSchedule.hbm.xml</value>
<value>/mappings/Advising/AppointmentStatusLookup.hbm.xml</value>
<value>/mappings/Advising/NostdAnswers.hbm.xml</value>
<value>/mappings/Advising/NostdQuestions.hbm.xml</value>
<value>/mappings/Advising/ScheduleCodeLookup.hbm.xml</value>
<value>/mappings/Advising/StdAnswerLookup.hbm.xml</value>
<value>/mappings/Advising/StdQuestionLookup.hbm.xml</value>
<value>/mappings/Advising/StdQuestions.hbm.xml</value>
<value>/mappings/Advising/StudentLogon.hbm.xml</value>
<value>/mappings/Advising/StudentUser.hbm.xml</value>
<value>/mappings/Advising/SupervisorLogon.hbm.xml</value>
<value>/mappings/Advising/SupervisorUser.hbm.xml</value>
</list>
</property>
</bean>
<bean id="managerSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="managerMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Manager/AdminLogon.hbm.xml</value>
<value>/mappings/Manager/AdminUser.hbm.xml</value>
<value>/mappings/Manager/AdvisorRegularHours.hbm.xml</value>
<value>/mappings/Manager/AdvisorServiceRoles.hbm.xml</value>
<value>/mappings/Manager/AdvisorStatusLog.hbm.xml</value>
<value>/mappings/Manager/AdvisorLogon.hbm.xml</value>
<value>/mappings/Manager/AdvisorUser.hbm.xml</value>
<value>/mappings/Manager/Department.hbm.xml</value>
<value>/mappings/Manager/FrontdeskLogon.hbm.xml</value>
<value>/mappings/Manager/FrontdeskStatusLog.hbm.xml</value>
<value>/mappings/Manager/FrontdeskUser.hbm.xml</value>
<value>/mappings/Manager/ServiceCatLookup.hbm.xml</value>
<value>/mappings/Manager/SupervisorLogon.hbm.xml</value>
<value>/mappings/Manager/SupervisorUser.hbm.xml</value>
<value>/mappings/Manager/SupervisorStatusLog.hbm.xml</value>
<value>/mappings/Manager/SystemHolidays.hbm.xml</value>
<value>/mappings/Manager/SystemSchoolYears.hbm.xml</value>
<value>/mappings/Manager/SystemSettings.hbm.xml</value>
<value>/mappings/Manager/UserStatusLookup.hbm.xml</value>
</list>
</property>
</bean>
<bean id="surveySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="dataSource">
<ref bean="surveyMainDataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>/mappings/Survey/SurveyBasicInfo.hbm.xml</value>
</list>
</property>
</bean>
<bean id="advisingTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="advisingSessionFactory"/></property>
<property name="dataSource"><ref local="advisingMainDataSource"/></property>
</bean>
<bean id="managerTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="managerSessionFactory"/></property>
<property name="dataSource"><ref local="managerMainDataSource"/></property>
</bean>
<bean id="surveyTxManager"
class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="surveySessionFactory"/></property>
<property name="dataSource"><ref local="surveyMainDataSource"/></property>
</bean>
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderIm pl">
<property name="host"><value>smtp.ucr.edu</value></property>
</bean>
<!--
Create the warehouse so it will already have a connection and keep a
refernce so it won't get GC'd
-->
<bean id="warehouse"
class="org.springframework.beans.factory.config.MethodInv okingFactoryBean"
lazy-init="true">
<property name="staticMethod">
<value>edu.ucr.c3.ucrwarehouse.WarehouseFactory.createWar ehouse</value>
</property>
</bean>
<!--
Configure velocity for our e-mail templates
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFact oryBean">
<property name="velocityProperties">
<props>
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.class">
org.apache.velocity.runtime.resource.loader.Classp athResourceLoader
</prop>
</props>
</property>
</bean>
-->
<!-- define a task that will call the synchronizeData method of a service bean
to keep our data synchronized
<bean id="dataSyncJob" class="org.springframework.scheduling.quartz.MethodInvoki ngJobDetailFactoryBean">
<property name="targetObject"><ref bean="academicService"/></property>
<property name="targetMethod"><value>synchronizeData</value></property>
<property name="concurrent"><value>false</value></property>
</bean>
<bean id="dailyDataSync" class="org.springframework.scheduling.quartz.CronTriggerB ean">
<property name="jobDetail">
<ref bean="dataSyncJob"/>
</property>
<property name="cronExpression">
<value>0 0 2 * * ? </value>
</property>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFac toryBean">
<property name="triggers">
<list>
<ref local="dailyDataSync"/>
</list>
</property>
<property name="autoStartup"><value>true</value></property>
</bean> -->
</beans>