Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x.x.x.xxResponse cannot be cast to x.x.x.xxResponse 异常可能原因 #5545

Closed
2 tasks done
xcorpio opened this issue Dec 27, 2019 · 1 comment
Closed
2 tasks done

Comments

@xcorpio
Copy link

xcorpio commented Dec 27, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.4.1
  • Operating System version: macos, linux
  • Java version: 1.8

背景

这个issue不是正常的使用场景下产生的啊... 我在做一个 dubbo 的压测工具 , 要在 JVM 不退出的情况下 重载 dubbo 的接口class. 如: GreetingService

public interface GreetingService {
  String sayHello(String name);
  HelloResponse sayHello2(String name);
}

现象

第一次调用时 HelloResponse 返回正常,类加载器是: pea.app.compiler.ReloadableClassLoader
(这个是我自定义的类加载器, 每次调用都会是新的)。

之后的调用就会报异常:

[error] p.d.a.DubboAction - failure: ==========> java.lang.ClassCastException: pea.example.ext.dubbo.response.HelloResponse cannot be cast to pea.example.ext.dubbo.response.HelloResponse
	at org.apache.dubbo.common.bytecode.proxy1.sayHello2(proxy1.java)
	at pea.example.dubbo.GreetingSimulation.$anonfun$scn$1(GreetingSimulation.scala:23)
	at pea.dubbo.action.DubboAction.$anonfun$execute$1(DubboAction.scala:43)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:658)
	at scala.util.Success.$anonfun$map$1(Try.scala:255)
	at scala.util.Success.map(Try.scala:213)

问题

这个问题大概是怎么产生的啊?为啥第一调用没事, 代理类返回的 HelloResponse是不是有缓存啊之类的?如果有怎么清掉?

@CrazyHZM
Copy link
Member

Try it with the latest version, if you still have problems, you can reopen the issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants