aspose file tools*
The moose likes Object Relational Mapping and the fly likes how to get session from spring-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to get session from spring-config.xml" Watch "how to get session from spring-config.xml" New topic
Author

how to get session from spring-config.xml

indu iyengar
Ranch Hand

Joined: Jul 30, 2010
Posts: 115
Hi all, am getting null pointer exception when try to access session --

dispatcher servlet code is :::

code to access session


thanks ,
Indu
Ran Pleasant
Ranch Hand

Joined: Jan 16, 2003
Posts: 75
Indu

I don't see any configuration where the "mysessionFactory" bean is being injected into the sessionFactory field, thus you get the Null exception. Therefore, you need to lookup the bean "mysessionFactory" and set it in the sessionFactory field.

Ran Pleasant

Ran
indu iyengar
Ranch Hand

Joined: Jul 30, 2010
Posts: 115
Thanks Ran ... got it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get session from spring-config.xml
 
Similar Threads
org.springframework.beans.NotReadablePropertyException
Spring Cofiguratation error
exceptions in spring configuration file.
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Dependency injection problem