2121import com .alipay .remoting .*;
2222import org .slf4j .Logger ;
2323
24- import com .alipay .remoting .exception .CodecException ;
25- import com .alipay .remoting .exception .ConnectionClosedException ;
2624import com .alipay .remoting .log .BoltLoggerFactory ;
2725import com .alipay .remoting .rpc .exception .InvokeException ;
28- import com .alipay .remoting .rpc .exception .InvokeServerBusyException ;
29- import com .alipay .remoting .rpc .exception .InvokeServerException ;
30- import com .alipay .remoting .rpc .exception .InvokeTimeoutException ;
31- import com .alipay .remoting .rpc .protocol .RpcResponseCommand ;
3226
3327/**
3428 * Listener which listens the Rpc invoke result, and then invokes the call back.
@@ -126,15 +120,15 @@ public void run() {
126120 + ResponseStatus .UNKNOWN , future .getCause ());
127121 }
128122
129- Object responseObj = RpcResponseResolver .resolveResponseObject (response ,
130- this .remoteAddress );
131-
132123 ClassLoader oldClassLoader = null ;
133124 try {
134125 if (future .getAppClassLoader () != null ) {
135126 oldClassLoader = Thread .currentThread ().getContextClassLoader ();
136127 Thread .currentThread ().setContextClassLoader (future .getAppClassLoader ());
137128 }
129+
130+ Object responseObj = RpcResponseResolver .resolveResponseObject (response ,
131+ this .remoteAddress );
138132 response .setInvokeContext (future .getInvokeContext ());
139133 try {
140134 callback .onResponse (responseObj );
@@ -159,6 +153,7 @@ public void run() {
159153 .error (
160154 "Exception occurred in user defined InvokeCallback#onException() logic, The address is {}" ,
161155 this .remoteAddress , te );
156+ // Consider rethrowing the exception or handling it according to your application's needs
162157 }
163158 }
164159
0 commit comments