dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[Bug] Triple unable to find class

Open Alleninggx opened this issue 1 year ago • 3 comments

Dubbo Version

Dubbo java 3.2.14

Steps to reproduce this issue

image image

我有一个tri类型的接口,但是我不是直接实现dubbo生成的接口类,而是自定义了一个接口(IFileResourceDubboGrpc),然后这个接口再继承Dubbo生成的接口(FileResourceDubboGrpc)。

I have an interface whose protocol is tri, but instead of directly implementing the dubbo generated interface class, I have a custom interface (IFileResourceDubboGrpc), which then extends the Dubbo generated interface (FileResourceDubboGrpc).

关系就是:FileResourceDubboGrpcImpl --实现--> IFileResourceDubboGrpc --继承--> FileResourceDubboGrpc

Like this:FileResourceDubboGrpcImpl --interface--> IFileResourceDubboGrpc --extends--> FileResourceDubboGrpc

这个在3.2.5版本左右,是正常的,然后我升级到3.2.14后,这个方式就没办法用了。

This is normal around version 3.2.5, and then after I upgraded to 3.2.14, this method can not be used.

现在是否只能是直接实现dubbo生成的接口了?

Now, what else can I do but implement this class directly?

What you expected to happen

获取接口的方式变了?

I haven't read the code in detail yet

java.lang.IllegalStateException: Not found class com.ligong.mes.system.api.dubbo.DubboIFileResourceDubboGrpcTriple, cause: com.ligong.mes.system.api.dubbo.DubboIFileResourceDubboGrpcTriple
	at org.apache.dubbo.common.utils.ReflectUtils.forName(ReflectUtils.java:690)
	at org.apache.dubbo.rpc.stub.StubSuppliers.getServiceDescriptor(StubSuppliers.java:61)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:347)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:238)
	at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:395)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:294)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:248)
	at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:271)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:555)
	at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:517)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:183)
	at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:156)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:157)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:143)
	at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:452)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:385)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:993)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:628)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
	at com.ligong.mes.equipment.server.EquipmentServerApplication.main(EquipmentServerApplication.java:23)

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • [ ] Yes I am willing to submit a pull request on my own!

Code of Conduct

Alleninggx avatar Jul 19 '24 09:07 Alleninggx

Thank you in English please.

heliang666s avatar Jul 20 '24 02:07 heliang666s

Thank you in English please.

In short, it involves catching exceptions thrown by service interface classes when using the triple protocol.

please only read the English in the issue, the Chinese content is only a translated, it is as same as the English content.

Alleninggx avatar Jul 20 '24 03:07 Alleninggx

@EarthChen PTAL

AlbumenJ avatar Jul 23 '24 03:07 AlbumenJ