This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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

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: 94
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
jQuery in Action, 2nd edition
subject: exceptions in spring configuration file.