-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
NullPointerException when using CompletionStage fetched by generated proxy #39
Comments
Hi @coldraydk, could you provide a small project that reproduces the problem? Thanks! |
You're letting I would return a citizen.thenApply(x -> ok("Everything is fine")) |
@coldraydk can you confirm that following @gmethvin suggestion fixed the problem? |
Hi guys, Thanks for the feedback. I'm on a tight schedule until Thursday, but I will come back to you at the end of next week. |
@coldraydk Do you have new information? |
I encounter this in my Play tests with plays mock server.
|
After some further investigation this seems to be more common if server is located on same host as client and also seems to occur more frequently on slower machines. It seems to occur when the server has responded with data and now CXF is about to parse/process this response data. Thus a successful call has been made, we've gotten a response and then when the response data is processed, it dies silently. It happens somewhere inside Apache CXF. And since a PlaySoap waits for a future to complete this NPE results in the future never completing the our PlaySoap call will eventually result in a TimeoutException with no further info. When narrowing down using breakpoints at HttpConduit.handleResponseOnWorkqueue and ClientImpl.destroy what seems to happen is that inside handleResponseOnWorkqueue we actually get a "Message received on a Client that has been closed or destroyed." exception. And this is becasue ClientImpl.destroy() is called before handleResponseOnWorkqueue and in the destroy method all resources are cleared. This seems to be related to https://issues.apache.org/jira/browse/CXF-6940 and this commit https://fisheye.apache.org/changelog/cxf?cs=e0ef66391d2e7e62e63e96214eca95e292271892. More specifically the ClientImpl.java lines
Compiling a new version of CXF with the above lines removed will result in this issue being resolved. So this issue might have been going on for a while. Maybe because of newer JDK / different GC it has become more topical since 2017? Other CXF ticket which seems to be related to this as well http://cxf.547215.n5.nabble.com/jira-Commented-CXF-7664-Upgrading-to-JDK-1-8-seems-to-cause-concurrency-issues-intermittently-Messagd-td5788109.html |
This is most likely fixed with the upgrade of CXF to 3.4.0 in #202 which is now released in Play SOAP 1.2.0 https://github.com/playframework/play-soap/releases/tag/1.2.0 |
As it turns out, the underlying problem is not fixed in CXF 3.4.0. |
@ennru do
Do you have any pointer or ideas how this could be achieved? |
IIUC, the problem occurs when the Making the
|
Has there been any progress regarding the solution of this problem ? Scala-PlayFw-ApacheCxf / Exception in thread “default-workqueue-1” java.lang.NullPointerException I would like to ask for opinions from those who are interested and have an opinion on the subject. Thanks. |
New Play application created through sbt running with the following versions:
My Java-classes are generated from the following internal service:
WsdlKeys.wsdlUrls in Compile += url("http://172.x.x.x/SOAP/PortalService.svc?wsdl")
Below is a simple index method in my controller. I've deliberately avoided the return type
CompletionStage<Result>
on the method for simplicity's sake:The NullPointerException appears to be sporadic (roughly 20% of the time), and can be avoided by sleeping the running thread. Below is a stack trace of when the exception is thrown:
Wireshark shows that the endpoint does provide it with data.
I'm unsure if this behaviour was introduced when you moved from promises to CompletionStages, but I imagine that it is likely. This does prevent me from using the plugin.
The text was updated successfully, but these errors were encountered: