Hello,
when i try to deploy my app im getting this error that has been frusturating me for the past 2 days. Here is the relevant information.
StackTrace:
Code:2006-02-27 15:28:42,453 [http-8080-Processor24] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminLogonDAO' defined in ServletContext resource [/WEB-INF/classes/spring-Advising-DAOs.xml]: Can't resolve reference to bean 'advisingSessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'advisingSessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'advisingSessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException at org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:63) at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:245) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:95) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:363) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:327) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:800) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:726) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:990) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:275) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:193) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:240) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveReference(AbstractAutowireCapableBeanFactory.java:898) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveValueIfNecessary(AbstractAutowireCapableBeanFactory.java:832) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:773) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:601) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:258) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:193) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:240) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:236) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:304) at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:167) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:101) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48) ......
spring.xml:
spring-Advising-DAOs.xml:Code:..... <bean id="advisingSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <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> .....
**NOTE: I had to cut the code sections short because i was getting length errors on the post. I tried to keep all the relevant information. If you need more please let me know.Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!-- SAP Advising Database DAO definitions --> <bean id="adminLogonDAO" class="edu.ucr.c3.sap.dao.advising.hibernate.AdminLogonDAO"> <property name="sessionFactory"><ref bean="advisingSessionFactory"/></property> </bean> .....
**
In the spring.xml the advisingDataSource is a bean defined elsewhere in file that makes the connection to the database. That works fine else that would of thrown an error. Again I am not seeing anything here that is causing this error.
Enviroment:
- Hibernate 3.1
- Spring 1.2
- Tomcat-5.0.28
If anyone can help me with this problem i would really appreciate it.
Thanks
-Ray


Reply With Quote