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 Object Relational Mapping and the fly likes Hibernate Envers not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Envers not working" Watch "Hibernate Envers not working" New topic
Author

Hibernate Envers not working

Sandro Queiroz Jr
Greenhorn

Joined: Mar 07, 2011
Posts: 4

Hi guys,

I'm trying to add auditing functionality in a Struts 2 web project. I'm using Hibernate Envers for auditing. But it's not working. I can't get the user's session.
My code is:


The line 17 is throwing an exception:


The console:

I'm using Open Session in View pattern to get hibernate's session: Open Session in View
Frameworks: Struts 2.3.1.2, Hibernate 3.6.10.Final
Container: Tomcat 6.0.24.

Ideas?
Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
Hi,

try using getCurrentSession() instead of getSession() .

Sandro Queiroz Jr
Greenhorn

Joined: Mar 07, 2011
Posts: 4

Hemant Thard wrote:Hi,

try using getCurrentSession() instead of getSession() .



Hi there.

There is not getCurrentSession() method in ActionContext --> ActionContext Docs
 
GeeCON Prague 2014
 
subject: Hibernate Envers not working