@@ -92,7 +92,7 @@ public static Object[] findMethod(Object service, String methodName, List<?> lis
9292 try {
9393 Object [] convertedArgs = ConversionUtils .convertParams (args , paramTypes );
9494 if (isTrace ) {
95- log .trace ("Method {} matched - parameters: {}" , methodName , paramTypes );
95+ log .trace ("Found method {} {} - parameters: {}" , methodName , method , paramTypes );
9696 }
9797 methodResult = new Object [] { method , convertedArgs };
9898 break ;
@@ -101,6 +101,9 @@ public static Object[] findMethod(Object service, String methodName, List<?> lis
101101 }
102102 }
103103 }
104+ if (isTrace ) {
105+ log .trace ("Method name: {} result: {}" , methodName , methodResult [0 ]);
106+ }
104107 }
105108 return methodResult ;
106109 }
@@ -118,6 +121,14 @@ public static Object[] findMethod(IConnection conn, IServiceCall call, Object se
118121 if (isDebug ) {
119122 log .debug ("Find method: {} in service: {} for call: {} and connection: {}" , methodName , service , call , conn );
120123 }
124+ // return value(s)
125+ Object [] methodResult = NULL_RETURN ;
126+ // clear any previous exception from the call as it may be reused
127+ if (call .getException () != null ) {
128+ log .debug ("Clearing status and exception from call: {}" , call );
129+ call .setStatus (Call .STATUS_PENDING );
130+ call .setException (null );
131+ }
121132 // get the arguments
122133 final Object [] args = call .getArguments ();
123134 // convert the args to their class types
@@ -138,8 +149,6 @@ public static Object[] findMethod(IConnection conn, IServiceCall call, Object se
138149 } else {
139150 argsWithConnection = conn != null ? new Object [] { conn } : new Object [0 ];
140151 }
141- // return value(s)
142- Object [] methodResult = NULL_RETURN ;
143152 // get all the name matched methods once, then filter out the ones that contain a $
144153 final Set <Method > methods = Arrays .stream (service .getClass ().getMethods ()).filter (m -> (m .getName ().equals (methodName ) && !m .getName ().contains ("$" ))).filter (m -> m .getParameterCount () == 1 || m .getParameterCount () == callParams .length || m .getParameterCount () == (callParams .length + 1 )).collect (Collectors .toUnmodifiableSet ());
145154 if (methods .isEmpty ()) {
@@ -182,7 +191,7 @@ public static Object[] findMethod(IConnection conn, IServiceCall call, Object se
182191 try {
183192 Object [] convertedArgs = ConversionUtils .convertParams (args , paramTypes );
184193 if (isTrace ) {
185- log .trace ("Method {} matched - parameters: {}" , methodName , paramTypes );
194+ log .trace ("Found method {} {} - parameters: {}" , methodName , method , paramTypes );
186195 }
187196 methodResult = new Object [] { method , convertedArgs };
188197 break ;
@@ -196,7 +205,7 @@ public static Object[] findMethod(IConnection conn, IServiceCall call, Object se
196205 try {
197206 Object [] convertedArgs = ConversionUtils .convertParams (argsWithConnection , paramTypes );
198207 if (isTrace ) {
199- log .trace ("Method {} matched - parameters: {}" , methodName , paramTypes );
208+ log .trace ("Found method {} {} - parameters: {}" , methodName , method , paramTypes );
200209 }
201210 methodResult = new Object [] { method , convertedArgs };
202211 break ;
@@ -205,6 +214,9 @@ public static Object[] findMethod(IConnection conn, IServiceCall call, Object se
205214 }
206215 }
207216 }
217+ if (isTrace ) {
218+ log .trace ("Method name: {} result: {}" , methodName , methodResult [0 ]);
219+ }
208220 if (methodResult [0 ] == null ) {
209221 log .warn ("Method {} not found in {} with parameters {}" , methodName , service , Arrays .asList (callParams ));
210222 call .setStatus (Call .STATUS_METHOD_NOT_FOUND );
0 commit comments