Our application is JSF2 based and we are desiging a exception handling for that. I tried using JSF2 exception handling framework configured in faces-config.xml.
When I throw a null pointer from backing bean, which is referred in Facelets page, then it is coming to exception handling function as javax.el.PropertyNotFoundException and also it doesn’t have any other stack trace about.
Is there any way to get the exact cause of the exception and the stack trace?
That will happen when the action method is called from inside a composite component. This is already been reported as JSF issue 1806 which is scheduled to be fixed for JSF 2.2.
As far now, there’s no way to get the root cause in the exception handler, because it’s completely swallowed. Your best bet is using a separate logger or, as a hacky workaround, to pass the exception as a request attribute yourself.