Hello,
I am trying to add hibernate to my existing spring application.I am using spring 2.5,hibernate annotations 3.2, mysql and
tomcat I have written applicationcontext.xml and hibernate.cfg.xml.
But I am getting this error
Context initialization failed.org.springframework.beans.factory.beandefinitionstoreexception: IOException parsing XML document from servletcontext resource [/web-inf/applicationcontext.xml]
nested exception is java.io.FilenotfoudException: could not open servletcontext resource [/web-inf/applicationContext.xml]
Below are the two config files
applicationContext.xml
****************************
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- the parent application context definition for the springapp application -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/bank</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.
LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="configLocation">
<value>WEB-INF\classes\hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>
<bean id="customerDAOimpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="customerDAO" class="com.palnar.college.DAO.customerDAOHibernateImpl.java"
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
</beans>
hibernate.cfg.xml
************************
<hibernate-configuration>
<session-factory>
<mapping package="com.palnar.college.service" />
<mapping class="com.palnar.college.service.Customer" />
</session-factory>
</hibernate-configuration>
web.xml
*************
......
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
......
PLEASE HELP ME OUT.THIS IS VERY URGENT