I have in my JSF 2 app on JBoss AS 7.1 a PrimeFaces 5.1 datatable with lazy loading and it sorts on page load, so I know my sorting implementation works, but when I click th
The stack trace tells that this exception occurred while handling an exception during restore view phase of an ajax request. This is a second problem which has unfortunately hidden away all detail about the underlying exception which JSF was trying to handle, so this question can't be answered by just looking at the stack trace until you fix/replace the standard exception handler.
If upgrading to latest Mojarra version doesn't solve it, then you can (temporarily) use the one shown in this answer to print the stack trace of the real underlying exception: Exception handling in JSF ajax requests. That should in turn give sufficient clues about the real underlying problem.