cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Coder One <coder_...@yahoo.com>
Subject Re: OneWay Destination / Original Thread / Exception
Date Thu, 18 Nov 2010 21:02:30 GMT
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?


----- Original Message ----
From: Daniel Kulp <dkulp@apache.org>
To: users@cxf.apache.org
Cc: Coder One <coder_lol@yahoo.com>
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
dkulp@apache.org
http://dankulp.com/blog



      

Mime
View raw message