NaikSoftware / StompProtocolAndroid

STOMP protocol via WebSocket for Android
MIT License
597 stars 265 forks source link

D/WebSocketsConnectionProvider: Emit lifecycle event: ERROR #45

Open shahabaejaz opened 7 years ago

shahabaejaz commented 7 years ago

Hi I get this error while implementing StompClient in Android.. //////////////////////////////////////////////////////////////////////// E/MainActivity: Error rx.exceptions.OnErrorNotImplementedException at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:386) at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:383) at rx.internal.util.ActionSubscriber.onError(ActionSubscriber.java:44) at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:152) at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onError(OnSubscribeMap.java:88) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:73) at rx.observers.Subscribers$5.onNext(Subscribers.java:235) at ua.naiksoftware.stomp.WebSocketsConnectionProvider.emitMessage(WebSocketsConnectionProvider.java:151) at ua.naiksoftware.stomp.WebSocketsConnectionProvider.access$300(WebSocketsConnectionProvider.java:29) at ua.naiksoftware.stomp.WebSocketsConnectionProvider$1.onMessage(WebSocketsConnectionProvider.java:98) at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:248) at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:371) at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:149) at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:185) at java.lang.Thread.run(Thread.java:818) Caused by: java.util.NoSuchElementException at java.util.Scanner.skip(Scanner.java:1547) at java.util.Scanner.skip(Scanner.java:1572) at ua.naiksoftware.stomp.client.StompMessage.from(StompMessage.java:80) at ua.naiksoftware.stomp.client.StompClient$$Lambda$2.call(Unknown Source) at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69) at rx.observers.Subscribers$5.onNext(Subscribers.java:235)  at ua.naiksoftware.stomp.WebSocketsConnectionProvider.emitMessage(WebSocketsConnectionProvider.java:151)  at ua.naiksoftware.stomp.WebSocketsConnectionProvider.access$300(WebSocketsConnectionProvider.java:29)  at ua.naiksoftware.stomp.WebSocketsConnectionProvider$1.onMessage(WebSocketsConnectionProvider.java:98)  at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:248)  at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:371)  at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:149)  at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:185)  at java.lang.Thread.run(Thread.java:818)  Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: o at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:73)

varo610 commented 7 years ago

I got the same error, any solution? Thanks

forresthopkinsa commented 7 years ago

Could you both provide some more details on how you got this error?

forresthopkinsa commented 7 years ago

You can catch this appropriately by implementing an "onError" override in your message subscription. Then you'll also be able to get more helpful error messages.

However, I'm concerned with what caused the error in the first place. If I'm reading this right, you're using the JWS impl, and you received a message "o", which caused the error. Does that sound right?

FusEcho commented 6 years ago

I got the same error,have you solved it yet>

forresthopkinsa commented 6 years ago

@Anotherdgf like I said a year ago, we need more information to be able to move forward with this. What causes the issue?

ivansulek commented 4 years ago

I had similar issue when header value contained string with whitespaces. Replacing header pattern to "([^:\s]+)\s*:\s*([^:\n]+)"helped solving this issue.

sorya-dev commented 4 years ago

Hi forresthopkinsa! I have a problem with "wss://" when I use this library "com.github.forresthopkinsa:StompProtocolAndroid:17.11.0". What causes the issue? and how should I do ? webSocketErr