You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/09/05 04:42:20 UTC

[GitHub] dz005 opened a new issue #2446: jarslink做module隔离时,dubbo调用会抛ClassNotFoundException

dz005 opened a new issue #2446: jarslink做module隔离时,dubbo调用会抛ClassNotFoundException
URL: https://github.com/apache/incubator-dubbo/issues/2446
 
 
   用jarslink做module隔离时,dubbo调用会抛ClassNotFoundException.经查是ClassLoader不一致.
   
   ```
       public static Class<?> getReturnType(Invocation invocation) {
           try {
               if (invocation != null && invocation.getInvoker() != null
                       && invocation.getInvoker().getUrl() != null
                       && !invocation.getMethodName().startsWith("$")) {
                   String service = invocation.getInvoker().getUrl().getServiceInterface();
                   if (service != null && service.length() > 0) {
                       Class<?> cls = ReflectUtils.forName(service);
                       Method method = cls.getMethod(invocation.getMethodName(), invocation.getParameterTypes());
                       if (method.getReturnType() == void.class) {
                           return null;
                       }
                       return method.getReturnType();
                   }
               }
           } catch (Throwable t) {
               logger.warn(t.getMessage(), t);
           }
           return null;
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org