cim icon indicating copy to clipboard operation
cim copied to clipboard

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

Open hensli opened this issue 3 years ago • 3 comments

  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()

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

hensli avatar Apr 20 '21 10:04 hensli

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

xilou31 avatar May 25 '21 08:05 xilou31

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

bdw9005 avatar Jul 05 '21 06:07 bdw9005

  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()

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

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

bdw9005 avatar Jul 05 '21 06:07 bdw9005