Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error-page issue with class inherited from RuntimeException


In my JSF Project (with framework primefaces), i defined in web.xml an error-page to display when java.lang.Exception is thrown.

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/erreur.xhtml</location>
</error-page>

That works fine when a RuntimeException is thrown (erreur.xhtml is displayed).

I also created a class (called TechnicalException) inherited from RuntimeException. When a TechnicalException is thrown, I can't explain why the error page doesn't display. Same case when i'm specifying "TechnicalException" in "exception-type" tag of web.xml.

When the TechnicalException is thrown, the request is still processing (favicon of the tab in processing mode) until session timeout.

Have you any idea about this behaviour ?

like image 560
Cédric Gecko Avatar asked May 21 '26 15:05

Cédric Gecko


1 Answers

I might have an idea: if you override the getCause() method it can result in a loop. Check your getCause() method and avoid "return this;"

Julien

like image 50
Julien Gecko Avatar answered May 24 '26 12:05

Julien Gecko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!