aspose file tools
The moose likes Spring and the fly likes Spring with Hibernate Integration Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Spring with Hibernate Integration" Watch "Spring with Hibernate Integration" New topic
Author

Spring with Hibernate Integration

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hello i am trying to learn .

After defining all the beans for Datasource , SessionFactory and more in the springs xml file , Can anybody tell me how the application will actually load this xml file in case of a web based application ?



Thanks in advance .


Save India From Corruption - Anna Hazare.
everson santos
Ranch Hand

Joined: Jul 11, 2009
Posts: 50
Try this in your web.xml

<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much , and one more query

Is it sufficient to mention it like this or do i need to call this the context params in the Application also to load the XML file ??


everson santos
Ranch Hand

Joined: Jul 11, 2009
Posts: 50

Only like that.

For me work. I'm greenhorn with spring
Eduardo Bueno
Ranch Hand

Joined: Jun 04, 2009
Posts: 154
It is sufficient, the ContextLoader will scan through your applicationContext.xml and do whatever it finds in there.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Spring with Hibernate Integration
 
Similar Threads
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
hibernate_springs
Error creating bean with name 'mySessionFactory' defined in class path:Error setting property values
Two TransactionTemplate use my single application.