users@glassfish.java.net

Re: JEE5 exception handling best practices

From: Witold Szczerba <pljosh.mail_at_gmail.com>
Date: Tue, 2 Dec 2008 18:14:18 +0100

If you want your exceptions not to be wrapped by EJBException, declare
them as application exceptions using annotation or in ejb descriptor.
In case of annotations, beware:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=5183
Application exceptions are delivered 'as is', so there is no
difference between them and any other exceptions from any other part
of your application.

Regards,
Witold Szczerba

2008/12/2 <glassfish_at_javadesktop.org>:
> Hello,
>
> Is there some documentation about exception handling best practices?
> For example how should I handle uncaught exceptions in case of EJBs (eg. logging them).
>
> Some more concrete info: I use an slf4j+logback based logger in my application. When an EJB throws an exception (like "throw new RuntimeException();"), this exception is not logged to the logback log file but to the server log as a javax.ejb.EJBException.
> What I want is to log some useful info to the logback-based "application log" as well.
>
> Do you have some suggestions?
>
> Thanks:
> Norbi
> [Message sent by forum member 'snorbicet' (snorbicet)]
>
> http://forums.java.net/jive/thread.jspa?messageID=319593
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>