Hello everyone. I'm a newbie in the spring world and this my first post. I'm trying integrating hibernate support to an existing spring project. In the beginning I replaced the hibernate configuration file by a SessionFactory bean and I Had to specify the mapping files by the mappingResources propriety and there where my problem is,I have an error 503 saying that the files dont exist here is my applicationContext.xml:
I have an error 503 and in the error stack it says that the files don't exist. The files are on the WEB-INF I have tried /WEB-INF/product.hbm.xml or classpath: product.hbm.xml but the error persisted.Code:<?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:p="http://www.springframework.org/schema/p" 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.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!--bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="/WEB-INF/jdbc.properties" /> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /--> <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) --> <bean id="implProduct" class="akatsuki.domain.service.ProductImplementation"> <property name="productDao" ref="productDaoHibernate"/> </bean> <bean id="productHibernate" class="akatsuki.domain.repositry.ProductHibernate" > <property name="hibernateTemplate" ref="hibernateTemplate"/> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory"> <ref bean="mySessionFactory"/> </property> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="hibernateProperties"> <props> <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop> <prop key="hibernate.connection.url">jdbc:mysql://localhost:3306/achat</prop> <prop key="hibernate.connection.username">root</prop> <prop key="hibernate.connection.password">bankai</prop> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> </props> </property> <property name="mappingResources"> <list> <value>product.hbm.xml</value> </list> </property> </bean> <bean id="TransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"><ref local="mySessionFactory"/></property> </bean> </beans>


Reply With Quote