crossoverJie / cim

📲cim(cross IM) 适用于开发者的分布式即时通讯系统
https://crossoverjie.top/categories/Netty/
MIT License
9.22k stars 2.84k forks source link

cim-client启动异常,ProxyManager $Proxy66.toString() error #119

Open hensli opened 3 years ago

hensli commented 3 years ago
  1. RouteRequestImpl.getCIMServer()
  2. RouteApi routeApi = new ProxyManager<>(RouteApi.class, routeUrl, okHttpClient).getInstance();
  3. 动态代理调用接口时抛出一下异常

【异常】Method threw 'java.lang.reflect.UndeclaredThrowableException' exception. Cannot evaluate com.sun.proxy.$Proxy66.toString()

【求问】这种情况要如何解决啊。

xilou31 commented 3 years ago

能提供上下文吗..比如项目中用到RouteRequestImpl.getCIMServer()的代码。

bdw9005 commented 3 years ago

因为ProxyManager中使用JDK动态代理,其invoke方法中是通过反射方法对Model进行的取值处理,故调用的接口方法入参可以改成model就不会出现这种错误了。。。

bdw9005 commented 3 years ago
  1. RouteRequestImpl.getCIMServer()
  2. RouteApi routeApi = new ProxyManager<>(RouteApi.class, routeUrl, okHttpClient).getInstance();
  3. 动态代理调用接口时抛出一下异常

【异常】Method threw 'java.lang.reflect.UndeclaredThrowableException' exception. Cannot evaluate com.sun.proxy.$Proxy66.toString()

【求问】这种情况要如何解决啊。

同上面的回答,可以尝试一下