Please can anyone help me figure out why I get this error. This is my application context
And this is the error logCode:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> <!-- Define Data Source Object --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/etranscript" /> <property name="username" value="username" /> <property name="password" value="password" /> </bean> <!-- Define Hibernate Session Factory Object --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingResources"> <list> <value>com/psi/etranscript/model/graduate.hbm.xml</value> <value>com/psi/etranscript/model/pricelist.hbm.xml</value> <value>com/psi/etranscript/model/recipient.hbm.xml</value> <value>com/psi/etransript/model/request.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.cglib.use_reflection_optimizer"> true </prop> <prop key="hibernate.cache.provider_class"> org.hibernate.cache.HashtableCacheProvider </prop> </props> </property> </bean> <!-- Define the Dao Objects --> <bean id="graduateDao" class="com.psi.etranscript.dao.hibernate.GraduateDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="recipientDao" class="com.psi.etranscript.dao.hibernate.RecipientDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="priceListDao" class="com.psi.etranscript.dao.hibernate.PriceListDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="requestDao" class="com.psi.etranscript.dao.hibernate.RequetDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- Define the Service Objects --> <bean id="graduateService" class="com.psi.etranscript.service.impl.GraduateServiceImpl"> <property name="graduateDao" ref="graduateDao" /> </bean> <bean id="RecipientService" class="com.psi.etranscript.service.impl.RecipientServiceImpl"> <property name="recipientDao" ref="recipientDao" /> </bean> <bean id="RequestService" class="com.psi.etranscript.service.impl.RequestServiceImpl"> <property name="requestDao" ref="requestDao" /> </bean> <bean id="priceListService" class="com.psi.etranscript.service.impl.PriceListServiceImpl"> <property name="priceListDao" ref="priceListDao" /> </bean> </beans>
Please any help will be really appreciatedCode:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [appContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.Configuration]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError Caused by: java.lang.ExceptionInInitializerError at org.hibernate.cfg.Configuration.reset(Configuration.java:168) at org.hibernate.cfg.Configuration.<init>(Configuration.java:187) at org.hibernate.cfg.Configuration.<init>(Configuration.java:191) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:779) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:561) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75) at com.psi.etranscript.util.impl.ServiceLocatorImpl.<init>(ServiceLocatorImpl.java:24) at com.psi.etranscript.test.Test.testServiceLocator(Test.java:14) at com.psi.etranscript.test.Test.main(Test.java:10) Caused by: java.lang.NullPointerException at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:144) at org.hibernate.cfg.Environment.<clinit>(Environment.java:524) ... 26 more


Reply With Quote