You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "FoghostCn (via GitHub)" <gi...@apache.org> on 2024/03/17 12:06:56 UTC
[I] [Bug] java.lang.ClassCastException: org.apache.dubbo.samples.proto.GreetResponse cannot be cast to java.util.concurrent.CompletableFuture [dubbo]
FoghostCn opened a new issue, #13931:
URL: https://github.com/apache/dubbo/issues/13931
### Pre-check
- [X] I am sure that all the content I provide is in English.
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
Dubbo java: 3.2.11
Jdk: 1.8
OS: macos 14.2.1
### Steps to reproduce this issue
when use async method in java client and go server application level service discovery
1. start the nacos server
2. start the go-server:go run server.go
3. start the java-client:
```
CompletableFuture<GreetResponse> future = greetService.greetAsync(req);
GreetResponse greet = future.get();
```
```
Exception in thread "main" java.lang.ClassCastException: org.apache.dubbo.samples.proto.GreetResponse cannot be cast to java.util.concurrent.CompletableFuture
at org.apache.dubbo.samples.proto.DubboGreetServiceTriple$GreetServiceStub.greetAsync(DubboGreetServiceTriple.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.dubbo.config.spring.util.LazyTargetInvocationHandler.invoke(LazyTargetInvocationHandler.java:54)
at org.apache.dubbo.samples.proto.GreetServiceDubboProxy0.greetAsync(GreetServiceDubboProxy0.java)
at org.apache.dubbo.samples.Main.main(Main.java:26)
```
code is at:
https://github.com/FoghostCn/dubbo-go-samples/blob/async-bug/service_discovery/service/java-client/src/main/java/org/apache/dubbo/samples/Main.java
### What you expected to happen
async method invoke success
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [X] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] java.lang.ClassCastException: org.apache.dubbo.samples.proto.GreetResponse cannot be cast to java.util.concurrent.CompletableFuture [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #13931: [Bug] java.lang.ClassCastException: org.apache.dubbo.samples.proto.GreetResponse cannot be cast to java.util.concurrent.CompletableFuture
URL: https://github.com/apache/dubbo/issues/13931
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org