On Thursday 18 November 2010 4:02:30 pm Coder One wrote:
> Ouch...that's bad news for me...I need to get that exception to flag a
> problem to the underlying transport...nothing to do with SOAP
> really...just to be able to say...OOPS..something went wrong...
> 
> I tried the getExchange.get(Exception),
> getExchange().getInFault/OutFaultMesage without success...
> 
> Any other way we can interject some code into that oneway interceptor?

Actually, can you try updating to 2.3.0 or 2.2.10?   We did some changes to 
the PhaseInterceptorChain between 2.2.5 and 2.2.6 to have it set the exception 
and stuff even if it's a oneway.   Thus, just updating to a newer version may 
fix your issue.

BTW:  your custom destination could easily set the USE_ORIGINAL_THREAD as a 
property on the message before passing it into the observer.  At least with 
recent versions of CXF.  No configuring of the endpoint needed.

Dan




> 
> 
> ----- Original Message ----
> From: Daniel Kulp <[email protected]>
> To: [email protected]
> Cc: Coder One <[email protected]>
> Sent: Thu, November 18, 2010 10:52:28 AM
> Subject: Re: OneWay Destination / Original Thread / Exception
> 
> On Thursday 18 November 2010 1:47:34 pm Coder One wrote:
> > With CXF 2.2.5, my custom Destination makes use of the
> > USE_ORIGINAL_THREAD setting
> > 
> > @Oneway
> > void f()
> > {
> >
> >    throw new RuntimeException("ERROR");
> >
> > }
> > 
> > incomingObserver.onMessage(cxincomingmsg);
> > Exception e = (Exception)cxincomingmsg.getContent(Exception.class);
> > 
> > e is always null.  How can I retrieve the exception in my custom
> > destination when the function is @Oneway and throws an exception?
> 
> Honestly, I'm not sure you can.  Per spec, oneway operations are not
> allowed to throw faults or anything so it's likely to be swollowed.  It
> might be on the Exchange (msg.getExchange().get(Exception.class), but I'm
> not really sure.

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to