-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[SignalR] Java Client NullPointerException #6898
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
Comments
I'll investigate. Thanks! |
@JMaroz are you connecting to a traditional server-side Hub or are you connecting through the SignalR Service? Just curious. |
So I believe that I was running into this bug during my work on the LongPolling transport and I fixed it in that pr which is still under review #6856. The issue I believe was |
@bradygaster let me share some information about server side. The problem explained by @JMaroz happens with this configuration:
The client connects to simple Hub service that looks like this (more or less) public class MySuperHub : HubBase
{
public async Task DoSomethingSpecial(string param1, Guid param2, dynamic param3 = null)
{
// await ....
}
} Let me add another error we get server side in another mobile application (maybe could be helpful). Error message: Failed connection handshake. HttpHeaders: [Connection, upgrade], [Upgrade, websocket], [Accept-Encoding, gzip], [Host, mydomain.mycompany.com], [User-Agent, okhttp/3.10.0], [Origin, https://mydomain.mycompany.com/], [X-Original-Proto, https], [X-Forwarded-Port, 443], [X-Amzn-Trace-Id, Root=1-5c47e65a-d7286a28e44316b8c5463ea0], [Sec-WebSocket-Key, G9xa4kZDUhAyfAgF8iypFg==], [Sec-WebSocket-Version, 13], [X-Original-For, 10.202.3.196:51446] SourceContext: Microsoft.AspNetCore.SignalR.HubConnectionContext Didn't understand exactly when it happens because I don't have any stack (it happens not in my code but is logged as error). Let me know if you need more info. |
@mikaelm12 and @muratg would this be ready (or is it already in) for 2.2.3? |
@bradygaster To get this in 2.2.3, we'll need a PR with the fix with the label |
I don't think that that would be critical to get into 2.2.3. It's an error that happens in a failure in the close logic of the Java client. Happy to discuss it more though if people have other opinions. |
@mikaelm12 is there a release date w/ the fix for the java client? |
The fix for the null ref will be coming in Preview3, but that is not why your HubConnection fails to start. The exception you posted is the result of you HubConnection failing to start, not the cause of it I believe. Do you have any more logs or a repro app we can look at? |
The failure in the close logic was fixed here 3d3ad96 |
Describe the bug
When start the connection the SignalR HubConnection class throw an Exception
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.microsoft.signalr.HubConnection$ConnectionState.cancelOutstandingInvocations(java.lang.Exception)' on a null object reference at com.microsoft.signalr.HubConnection.stopConnection(HubConnection.java:6) at com.microsoft.signalr.HubConnection.lambda$start$6(HubConnection.java:1) at com.microsoft.signalr.s.invoke(Unknown Source:2) at com.microsoft.signalr.WebSocketTransport.onClose(WebSocketTransport.java:4) at com.microsoft.signalr.WebSocketTransport.lambda$start$1(WebSocketTransport.java:3) at com.microsoft.signalr.A.invoke(Unknown Source:2) at com.microsoft.signalr.OkHttpWebSocketWrapper$SignalRWebSocketListener.onFailure(OkHttpWebSocketWrapper.java:3) at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:84) at okhttp3.internal.ws.RealWebSocket$2.onFailure(RealWebSocket.java:1) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:8) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:3) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)
To Reproduce
Unable to reproduce the behavior, the crash happen randomly
Expected behavior
SignalR must catch the exception or not throw the exception
The text was updated successfully, but these errors were encountered: