Good trap avoidance documentation in web server context

I am currently reorganizing an existing code base (EJB) to rip out all the blocks where a Throwable is found inside an EJB.

try {
    ... do some business logic
} catch(Throwable t){
    ... log and swallow ... :-(
}

I want / have to convince others of the right documentation that “catching Throwable” is not a race for EJB (we have a lot of discussion around this). Weblogic will handle all error conditions and possibly invalidate the EJB and put the new (operational) EJBs in the pool. Catching Throwable can undermine all of these weblogic security networks and catching Throwable is bad practice anyway (but people here are reluctant and use the "Throwable" hammer everywhere).

Can someone point me to some online docs where this behavior is explained (for weblogic, jboss, etc.). I searched through Google and looked at documents in weblogic, but could not find anything, just a generic java document.

+3
source share
2 answers

They say the evidence is in the pudding.

Write a small example that does nothing except that it throws various exceptions (Runtime, Errors) and demonstrates that your container handles them gracefully.

This will stop critics dead in their ways.

+2
source
+4

Source: https://habr.com/ru/post/1744790/


All Articles