ningyu1 opened a new issue #1768: When the RPC protocol is HTTP, use 
GenericService.$invoke call error.
URL: https://github.com/apache/incubator-dubbo/issues/1768
 
 
   ## dubbo version
   
   dubbo-2.6.1
   
   ## provider service
   
   ```
   public interface MyClassService {
   
       public String sayHello();
   
       public String sayHello(MyClassVo vo, @Min(1) long id);
   
   }
   ```
   
   ## provider config
   
   ```
   <dubbo:application name="dubbo-test-main" />
   <!--         <dubbo:registry address="N/A" /> -->
   <dubbo:registry protocol="zookeeper"
                address="192.168.0.58:2181"/>
   <dubbo:protocol port="8090" name="http" />
   <dubbo:service protocol="http" 
interface="com.jiuyescm.dubbo.test.api.MyClassService" ref="myClassService"/>
   ```
   
   ## consumer use registry
   
   ```
   ApplicationConfig application = new ApplicationConfig();
   application.setName("DubboSample");
   ReferenceConfig reference = new ReferenceConfig();
   reference.setApplication(application);
   RegistryConfig registry = registry = new RegistryConfig();
   registry.setProtocol("zookeeper");
   registry.setAddress("192.168.0.58:2181");
   reference.setRegistry(registry);
   reference.setGeneric(true);
   GenericService genericService = (GenericService) reference.get();
   Object result = genericService.$invoke(getMethod(), new String[]{}, new 
Object[]{});
   ```
   
   ## consumer use dircet connection
   
   ```
   ApplicationConfig application = new ApplicationConfig();
   application.setName("DubboSample");
   ReferenceConfig reference = new ReferenceConfig();
   reference.setApplication(application);
   
reference.setUrl("http://192.168.6.47:8090/com.jiuyescm.dubbo.test.api.MyClassService";)
   reference.setGeneric(true);
   GenericService genericService = (GenericService) reference.get();
   Object result = genericService.$invoke(getMethod(), new String[]{}, new 
Object[]{});
   ```
   
   ## Error
   
   ```
   2018/05/10 12:20:39 ERROR - 
cn.tsoft.framework.testing.jmeter.plugin.dubbo.sample.DubboSample: 接口返回异常: 
com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote service: interface 
com.alibaba.dubbo.rpc.service.GenericService, method: $invoke, cause: 
Invocation of method [public abstract java.lang.Object 
com.alibaba.dubbo.rpc.service.GenericService.$invoke(java.lang.String,java.lang.String[],java.lang.Object[])
 throws com.alibaba.dubbo.rpc.service.GenericException] failed in HTTP invoker 
remote service at 
[http://192.168.6.47:8090/com.jiuyescm.dubbo.test.api.MyClassService]; nested 
exception is java.lang.NoSuchMethodException: 
com.sun.proxy.$Proxy18.$invoke(java.lang.String, [Ljava.lang.String;, 
[Ljava.lang.Object;)
        at 
com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol.getRpcException(AbstractProxyProtocol.java:119)
        at 
com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:99)
        at 
com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:142)
        at 
com.alibaba.dubbo.rpc.filter.GenericImplFilter.invoke(GenericImplFilter.java:172)
        at 
com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:68)
        at 
com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53)
        at 
com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:68)
        at 
com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:74)
        at 
com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:68)
        at 
com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:47)
        at 
com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:68)
        at 
com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:73)
        at 
com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:51)
        at com.alibaba.dubbo.common.bytecode.proxy0.$invoke(proxy0.java)
        at 
cn.tsoft.framework.testing.jmeter.plugin.dubbo.sample.DubboSample.callDubbo(DubboSample.java:463)
        at 
cn.tsoft.framework.testing.jmeter.plugin.dubbo.sample.DubboSample.sample(DubboSample.java:321)
        at 
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
        at 
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
        at java.lang.Thread.run(Thread.java:744)
   Caused by: org.springframework.remoting.RemoteInvocationFailureException: 
Invocation of method [public abstract java.lang.Object 
com.alibaba.dubbo.rpc.service.GenericService.$invoke(java.lang.String,java.lang.String[],java.lang.Object[])
 throws com.alibaba.dubbo.rpc.service.GenericException] failed in HTTP invoker 
remote service at 
[http://192.168.6.47:8090/com.jiuyescm.dubbo.test.api.MyClassService]; nested 
exception is java.lang.NoSuchMethodException: 
com.sun.proxy.$Proxy18.$invoke(java.lang.String, [Ljava.lang.String;, 
[Ljava.lang.Object;)
        at 
org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:158)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy8.$invoke(Unknown Source)
        at 
com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
        at 
com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:45)
        at 
com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:71)
        at 
com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:94)
        ... 18 more
   Caused by: java.lang.NoSuchMethodException: 
com.sun.proxy.$Proxy18.$invoke(java.lang.String, [Ljava.lang.String;, 
[Ljava.lang.Object;)
        at java.lang.Class.getMethod(Class.java:1665)
        at 
org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:204)
        at 
org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:39)
        at 
org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
        at 
org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)
        at 
org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)
        at 
com.alibaba.dubbo.rpc.protocol.http.HttpProtocol$InternalHandler.handle(HttpProtocol.java:147)
        at 
com.alibaba.dubbo.remoting.http.servlet.DispatcherServlet.service(DispatcherServlet.java:60)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:890)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:743)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:215)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407)
        at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)
        at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
        at 
org.springframework.remoting.support.RemoteInvocationUtils.fillInClientStackTraceIfPossible(RemoteInvocationUtils.java:45)
        at 
org.springframework.remoting.support.RemoteInvocationResult.recreate(RemoteInvocationResult.java:149)
        at 
org.springframework.remoting.support.RemoteInvocationBasedAccessor.recreateRemoteInvocationResult(RemoteInvocationBasedAccessor.java:85)
        at 
org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:150)
        ... 25 more
   
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to