You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sebastien <se...@gmail.com> on 2014/08/11 15:12:25 UTC
WebSockets: IKey not Serializable ?
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
(wicket-native-websocket-javax).
>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;
@Override
protected void onConnect(ConnectedMessage message)
{
super.onConnect(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,
Sebastien.
[1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
[2] http://wicket.apache.org/guide/guide/nativewebsockets.html
Re: WebSockets: IKey not Serializable ?
Posted by Sebastien <se...@gmail.com>.
Cloned, build, tested & approved! Many thanks for this super-quick fix,
that's rocks! :)
On Mon, Aug 11, 2014 at 3:29 PM, Martin Grigorov <mg...@apache.org>
wrote:
> Improved!
> Thanks!
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
>
> On Mon, Aug 11, 2014 at 3:27 PM, Sebastien <se...@gmail.com> wrote:
>
> > Done, thanks Martin!
> > https://issues.apache.org/jira/browse/WICKET-5670
> >
> >
> >
> > On Mon, Aug 11, 2014 at 3:18 PM, Martin Grigorov <mg...@apache.org>
> > wrote:
> >
> > > It should be Serializable (IClusterable for consistency).
> > > Please file a ticket.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > >
> > > On Mon, Aug 11, 2014 at 3:12 PM, Sebastien <se...@gmail.com> wrote:
> > >
> > > > 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
> > > > (wicket-native-websocket-javax).
> > > >
> > > > 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;
> > > >
> > > > @Override
> > > > protected void onConnect(ConnectedMessage message)
> > > > {
> > > > super.onConnect(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,
> > > > Sebastien.
> > > >
> > > > [1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
> > > > [2] http://wicket.apache.org/guide/guide/nativewebsockets.html
> > > >
> > >
> >
>
Re: WebSockets: IKey not Serializable ?
Posted by Martin Grigorov <mg...@apache.org>.
Improved!
Thanks!
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Aug 11, 2014 at 3:27 PM, Sebastien <se...@gmail.com> wrote:
> Done, thanks Martin!
> https://issues.apache.org/jira/browse/WICKET-5670
>
>
>
> On Mon, Aug 11, 2014 at 3:18 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > It should be Serializable (IClusterable for consistency).
> > Please file a ticket.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> >
> > On Mon, Aug 11, 2014 at 3:12 PM, Sebastien <se...@gmail.com> wrote:
> >
> > > 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
> > > (wicket-native-websocket-javax).
> > >
> > > 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;
> > >
> > > @Override
> > > protected void onConnect(ConnectedMessage message)
> > > {
> > > super.onConnect(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,
> > > Sebastien.
> > >
> > > [1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
> > > [2] http://wicket.apache.org/guide/guide/nativewebsockets.html
> > >
> >
>
Re: WebSockets: IKey not Serializable ?
Posted by Sebastien <se...@gmail.com>.
Done, thanks Martin!
https://issues.apache.org/jira/browse/WICKET-5670
On Mon, Aug 11, 2014 at 3:18 PM, Martin Grigorov <mg...@apache.org>
wrote:
> It should be Serializable (IClusterable for consistency).
> Please file a ticket.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
>
> On Mon, Aug 11, 2014 at 3:12 PM, Sebastien <se...@gmail.com> wrote:
>
> > 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
> > (wicket-native-websocket-javax).
> >
> > 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;
> >
> > @Override
> > protected void onConnect(ConnectedMessage message)
> > {
> > super.onConnect(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,
> > Sebastien.
> >
> > [1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
> > [2] http://wicket.apache.org/guide/guide/nativewebsockets.html
> >
>
Re: WebSockets: IKey not Serializable ?
Posted by Martin Grigorov <mg...@apache.org>.
It should be Serializable (IClusterable for consistency).
Please file a ticket.
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Mon, Aug 11, 2014 at 3:12 PM, Sebastien <se...@gmail.com> wrote:
> 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
> (wicket-native-websocket-javax).
>
> 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;
>
> @Override
> protected void onConnect(ConnectedMessage message)
> {
> super.onConnect(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,
> Sebastien.
>
> [1] http://wicketinaction.com/2012/07/wicket-6-native-websockets/
> [2] http://wicket.apache.org/guide/guide/nativewebsockets.html
>