This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Spring and the fly likes exceptions in spring configuration file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "exceptions in spring configuration file." Watch "exceptions in spring configuration file." New topic

exceptions in spring configuration file.

indu iyengar
Ranch Hand

Joined: Jul 30, 2010
Posts: 115
Hi all ,
while integrating spring with hibernate, my spring configuration file is ::::

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/"/>
<property name="suffix" value=".jsp"/>

<bean name="/login.htm" class="com.controllers.LoginController">
<property name="validator"><ref bean="loginValidator"/></property>
<property name="formView" value="LoginForm"></property>
<property name="successView" value="LoginSuccess"></property>
<property name="commandName" value="loginStudent"></property>
<property name="commandClass" value="com.bean.LoginStudent"></property>
<property name="sessionForm" value="true"></property>

<bean id="loginValidator" class="com.validate.LoginValidator"></bean>

<bean id="messageSource"
<property name="basename" value="messages">

<!-- ********************** DB (Hibernate) details ********************************* -->

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="password" value="admin"></property>
<property name="url" value="jdbc:mysql:///test"></property>
<property name="username" value="root"></property>

<bean id="ex_hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="">update</prop>
<prop key="hibernate.show_sql">true</prop>

<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"></ref></property>
<property name="hibernateProperties"><ref local="ex_hibernateProperties"></ref></property>


when running the following exception is coming ..

I need to provide again file again ?

thanks ,
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 99
Hello Indu,

You will have to mention the JDBC Connection details to hibernateProperties Bean definition, which will be used by LocalSessionFactoryBean.

Also, it depends on your type of transaction management you are trying to do!

Hope this helps.

Regards, Sujeeth Pakala
SCJP, SCWCD, SCBCD, ICAD, XML Master Basic, Certified SOA Professional
I agree. Here's the link:
subject: exceptions in spring configuration file.
jQuery in Action, 3rd edition