• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Envers not working

 
Sandro Queiroz Jr
Greenhorn
Posts: 4
Java Linux Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

try using getCurrentSession() instead of getSession() .

 
Sandro Queiroz Jr
Greenhorn
Posts: 4
Java Linux Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hemant Thard wrote:Hi,

try using getCurrentSession() instead of getSession() .



Hi there.

There is not getCurrentSession() method in ActionContext --> ActionContext Docs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic