It seems that the exception is being detected by the Liferay container itself which ends up writing out the original Ajax update as well as the full page of the status portlet response (see the attached screen shot). I wouldn't have thought that Liferay would even see these exceptions as part of the Ajax request/response so I decided to concentrate on that and found a couple of things:
- The LiferayFaces Bridge has the ExceptionHandlerAjaxImpl logging all the Ajax exceptions as a troubleshooting tool. We have something similar in our own custom exception handler when we found that Mojarra wasn't logging anything and certain problems related to Ajax were difficult to pin down.
However, we switched to only doing it when ProjectStage = Development to avoid logging what amounts to normal behaviour (like ViewExpiredExceptions). This is not part of the current issue we're seeing but it does tend to generate some extra noise that you may not want in a production environment. So I modified the bridge's ExceptionHandlerAjaxImpl to do something similar:
- The real problem seems to be in BridgePhaseResourceImpl (again, a class in the LiferayFaces Bridge) where exceptions are detected, wrapped, and rethrown as BridgeExceptions. This causes them to trickle up to the container (Liferay) which does it's own error handling and sticks the "status" page onto the end of the Ajax response. To verify this, I made a slight alteration so that the extra wrapping is only done if this is not currently an Ajax request:
I'll follow up with Neil about what we will do about these two issues and create/link additional JIRAs as required.
Assigning to Mircea. I'll try and add more detail on how to reproduce this.