wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien <seb...@gmail.com>
Subject WebSockets: IKey not Serializable ?
Date Mon, 11 Aug 2014 13:12:25 GMT
Hi all,

I've got a simple use-case: I would like to run a long-processing task
(through as EJB) and update the UI according to the progress. So, I would
like to see how I can achieve this using native websockets

>From various samples I saw (for instance [1]), the pageId is kept and later
we use this pageId to retrieve the connection. It seems that things changed
a little and pageId as been replaced by an IKey instance, which is not
Serializable. So code like run into an exception:

this.add(new WebSocketBehavior() {
    private static final long serialVersionUID = 1L;

    protected void onConnect(ConnectedMessage message)

        LOG.info("Client connected");

        applicationName = message.getApplication().getName();
        sessionId = message.getSessionId();
        key = message.getKey();

This leads to:
private org.apache.wicket.protocol.ws.api.registry.IKey
MyPage.key [class=org.apache.wicket.protocol.ws.api.registry.PageIdKey]
<----- field that is causing the problem

Is it intended that IKey is not Serializable? Am I supposed to use new
PageIdKey(butwhatpageid) ?

In the wicket guide, the snippet [2] does use the key... but it isn't
declared so I don't see where it comes from... Maybe a little update would
be useful for beginners like me! :)

Many thanks in advance & best regards,

[1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
[2] http://wicket.apache.org/guide/guide/nativewebsockets.html

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