wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Web Socket Exceptions.
Date Thu, 03 Nov 2016 09:07:34 GMT
Hi,

It is a bug in Wicket Native WebSocket.
https://github.com/apache/wicket/blob/d9d142b0738e289e639165523c4190727e281519/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java#L310
returns a null and still we try to push the message.

Please file a ticket in JIRA! Thanks!


What is the idea of your implementation? To notify the other users of the
app that some user have left? Like in a chat app?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Nov 2, 2016 at 5:01 PM, Peter Henderson <peter.henderson@starjar.com
> wrote:

> Hi  all.
>
> wicket 7.3
> tomcat 8.5.5
>
>
> I'm starting to see many more exceptions in relation to web sockets.
>
> [1]
>
> I have a HttpSessionListener, which sends a message to an actor when a
> session is destroyed  (aka user logout). The actor eventually broadcasts a
> web socket message.
>
> Am I doing something wrong in my code [2]?
>
>
>
>
> [1]
>
> oawpwa.AbstractWebSocketProcessor An error occurred during processing of a
> WebSocket message
> java.lang.IllegalArgumentException: Argument 'component' may not be null.
>         at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
>         at
> org.apache.wicket.protocol.ws.api.WebSocketRequestHandler.<
> init>(WebSocketRequestHandler.java:59)
>         at
> org.apache.wicket.protocol.ws.WebSocketSettings.
> newWebSocketRequestHandler(WebSocketSettings.java:220)
>         at
> org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.
> broadcastMessage(AbstractWebSocketProcessor.java:245)
>         at
> org.apache.wicket.protocol.ws.api.AbstractWebSocketConnection.sendMessage(
> AbstractWebSocketConnection.java:43)
>         at
> org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster$1.run(
> WebSocketPushBroadcaster.java:124)
>         at
> org.apache.wicket.protocol.ws.WebSocketSettings$SameThreadExecutor.run(
> WebSocketSettings.java:246)
>         at
> org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.process(
> WebSocketPushBroadcaster.java:119)
>         at
> org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.broadcastAll(
> WebSocketPushBroadcaster.java:109)
>         at
> com.starjar.engine.LoggedInUserTrackerActor.broadcastStats(
> LoggedInUserTrackerActor.scala:69)
>         at
> com.starjar.engine.LoggedInUserTrackerActor$$
> anonfun$receive$1.applyOrElse(LoggedInUserTrackerActor.scala:125)
>         at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
>         at
> com.starjar.engine.LoggedInUserTrackerActor.aroundReceive(
> LoggedInUserTrackerActor.scala:31)
>         at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
>         at akka.actor.ActorCell.invoke(ActorCell.scala:487)
>         at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
>         at akka.dispatch.Mailbox.run(Mailbox.scala:220)
>         at
> akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(
> AbstractDispatcher.scala:397)
>         at
> scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
>         at
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.
> runTask(ForkJoinPool.java:1339)
>         at
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
>         at
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
> ForkJoinWorkerThread.java:107)
>
>
>
>
>
> [2] The broadcasting code running in my actor.
>
> private def buildLoggedInUserMessage(): CurrentlyLoggedInUsers = {
>   val response = ... /* snip snip snip */
>   response
> }
>
> def broadcastStats(): Unit = {
>   val application = WicketStarjarApplication.get()
>   val webSocketSettings = WebSocketSettings.Holder.get(application)
>   val broadcaster = new
> WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry())
>   broadcaster.broadcastAll(application, buildLoggedInUserMessage)
> }
>
>
>
>
>
>
> Thanks
>
> Peter.
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Peter Henderson
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message