Author: ffang Date: Thu Nov 18 11:08:52 2010 New Revision: 1036405 URL: http://svn.apache.org/viewvc?rev=1036405&view=rev Log: Merged revisions 1036401 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes
................ r1036401 | ffang | 2010-11-18 19:00:21 +0800 (四, 18 11 2010) | 9 lines Merged revisions 1036397 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1036397 | ffang | 2010-11-18 18:53:33 +0800 (四, 18 11 2010) | 1 line [CXF-3132]asynchronous client can't get correct error if non-runtimeexcpetion happen ........ ................ Added: cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java - copied unchanged from r1036401, cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerWithHugeResponseTest.java cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/HugeResponseInterceptor.java - copied unchanged from r1036401, cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/HugeResponseInterceptor.java cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/resources/stack_overflow_rs.xml - copied unchanged from r1036401, cxf/branches/2.3.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/resources/stack_overflow_rs.xml Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=1036405&r1=1036404&r2=1036405&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original) +++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Thu Nov 18 11:08:52 2010 @@ -730,7 +730,31 @@ public class ClientImpl } else if (message.getContent(Exception.class) != null) { outFaultObserver.onMessage(message); } else { - chain.doIntercept(message); + callback = message.getExchange().get(ClientCallback.class); + + if (callback != null && !isPartialResponse(message)) { + try { + chain.doIntercept(message); + } catch (Throwable error) { + //so that asyn callback handler get chance to + //handle non-runtime exceptions + message.getExchange().setInMessage(message); + Map<String, Object> resCtx = CastUtils + .cast((Map<?, ?>) message.getExchange() + .getOutMessage().get( + Message.INVOCATION_CONTEXT)); + resCtx = CastUtils.cast((Map<?, ?>) resCtx + .get(RESPONSE_CONTEXT)); + if (resCtx != null) { + responseContext.put(Thread.currentThread(), resCtx); + } + callback.handleException(resCtx, error); + + } + } else { + chain.doIntercept(message); + } + } callback = message.getExchange().get(ClientCallback.class);
