You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Karl Kildén <ka...@gmail.com> on 2014/09/13 11:05:40 UTC

SessionScoped @ExceptionHandler?

Hello,

SessionScoped @ExceptionHandler is this supported / considered normal
practice? The problem is when the exception is from a job with no active
sessionscope I get ContextNotActiveException.

I was excepting a log message warning me that it could not send it for
obvious reasons... My SessionScoped exceptionhandler collects information
per user basis and it works smoothly when the exception was caused by user
action.

cheers

Re: SessionScoped @ExceptionHandler?

Posted by Jason Porter <li...@gmail.com>.
Scoped exception handlers was never a thing, I don't even recall it being
something I toyed with in the early Seam Catch stuff. If you're looking to
handle an exception only for a certain phase/time/etc. use a qualifier.

On Saturday, September 13, 2014, John D. Ament <jo...@gmail.com>
wrote:

> Karl,
>
> It's unclear whether or not you're expecting this to work.  If you want
> your exception handler to work when it's session scoped, you need to start
> a session scope w/ CDI Ctrl.
>
> On Sat, Sep 13, 2014 at 5:05 AM, Karl Kildén <karl.kilden@gmail.com
> <javascript:;>> wrote:
>
> > Hello,
> >
> > SessionScoped @ExceptionHandler is this supported / considered normal
> > practice? The problem is when the exception is from a job with no active
> > sessionscope I get ContextNotActiveException.
> >
> > I was excepting a log message warning me that it could not send it for
> > obvious reasons... My SessionScoped exceptionhandler collects information
> > per user basis and it works smoothly when the exception was caused by
> user
> > action.
> >
> > cheers
> >
>


-- 
Jason Porter
http://en.gravatar.com/lightguardjp

Re: SessionScoped @ExceptionHandle

Posted by ka...@gmail.com.
Hi, I want it to work the same way as cdi events normally works. I think the behavior in owb is a warn log that it could not be called. 

> 13 sep 2014 kl. 13:33 skrev "John D. Ament" <jo...@gmail.com>:
> 
> Karl,
> 
> It's unclear whether or not you're expecting this to work.  If you want
> your exception handler to work when it's session scoped, you need to start
> a session scope w/ CDI Ctrl.
> 
> On Sat, Sep 13, 2014 at 5:05 AM, Karl Kildén <ka...@gmail.com> wrote:
> 
>> Hello,
>> 
>> SessionScoped @ExceptionHandler is this supported / considered normal
>> practice? The problem is when the exception is from a job with no active
>> sessionscope I get ContextNotActiveException.
>> 
>> I was excepting a log message warning me that it could not send it for
>> obvious reasons... My SessionScoped exceptionhandler collects information
>> per user basis and it works smoothly when the exception was caused by user
>> action.
>> 
>> cheers
>> 

Re: SessionScoped @ExceptionHandler?

Posted by "John D. Ament" <jo...@gmail.com>.
Karl,

It's unclear whether or not you're expecting this to work.  If you want
your exception handler to work when it's session scoped, you need to start
a session scope w/ CDI Ctrl.

On Sat, Sep 13, 2014 at 5:05 AM, Karl Kildén <ka...@gmail.com> wrote:

> Hello,
>
> SessionScoped @ExceptionHandler is this supported / considered normal
> practice? The problem is when the exception is from a job with no active
> sessionscope I get ContextNotActiveException.
>
> I was excepting a log message warning me that it could not send it for
> obvious reasons... My SessionScoped exceptionhandler collects information
> per user basis and it works smoothly when the exception was caused by user
> action.
>
> cheers
>

Re: SessionScoped @ExceptionHandler?

Posted by Thomas Andraschko <an...@gmail.com>.
Hi,

i think we should check if the context of the @ExceptionHandler is
currently active before calling it.


2014-09-13 11:05 GMT+02:00 Karl Kildén <ka...@gmail.com>:

> Hello,
>
> SessionScoped @ExceptionHandler is this supported / considered normal
> practice? The problem is when the exception is from a job with no active
> sessionscope I get ContextNotActiveException.
>
> I was excepting a log message warning me that it could not send it for
> obvious reasons... My SessionScoped exceptionhandler collects information
> per user basis and it works smoothly when the exception was caused by user
> action.
>
> cheers
>