This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Envers not working