Good afternoon, Is there any way to have Comet channels using the wicket-atmosphere API? For instance, with the Broadcaster API, you could use a MetaBroadcaster which used to have a broadcasterID parameter.
I can't figure out how to integrate that in my wicket-atmosphere code and the JavaDoc from EventBus#post() reads: "Post an event to *all* pages that have a suspended connection". Any help will be much appreciated! Regards, Pierre Goupil On Thu, Aug 9, 2012 at 10:17 AM, Pierre Goupil <[email protected]> wrote: > > Thanks!!! I'll have a close look at your ticket. And yes, I use Tomcat > (7.0.29). I know it's all beta code, so no worries. > > Regards, > > Pierre > > > > > On Thu, Aug 9, 2012 at 10:02 AM, Emond Papegaaij <[email protected]> > wrote: >> >> We've noticed this problem as well. It only happens on Tomcat. I'm not sure >> what is going on, but it all starts with Tomcat loosing query parameters on >> the ws-request ("url/?0-1.IBehaviorListener.0-" is changed to "url"). This >> makes it impossible for wicket to recognize the call to a behavior, causing a >> redirect to a new page on the ws-request, which is not allowed. >> >> The question is, is this a bug in Tomcat, Atmosphere or wicket-atmosphere. I >> would say it's a bug in Atmosphere. I've created a ticket for this: >> https://github.com/Atmosphere/atmosphere/issues/553 >> >> For now, using jetty is a work around. >> >> Best regards, >> Emond >> >> On Wednesday 08 August 2012 20:59:10 Pierre Goupil wrote: >> > Hello, >> > >> > It looks like a problem with the WebSockets. I've tried to provide a >> > Locale, but no way: >> > >> > class MySession extends WebSession >> > { >> > private static final long serialVersionUID = 1L; >> > >> > public MySession(final Request req) >> > { >> > super(req); >> > } >> > >> > @Override >> > public void setLocale(final Locale locale) >> > { >> > super.setLocale(new Locale("en", "GB")); >> > } >> > } >> > >> > and in my WicketApplication: >> > >> > @Override >> > public Session newSession( final Request req, final Response res ) { >> > return new MySession(req); >> > } >> > >> > It all gives me the same error. >> > >> > BUT if I deactivate the WebSockets, it works: >> > >> > <init-param> >> > <param-name>org.atmosphere.useWebSocket</param-name> >> > <param-value>FALSE</param-value> >> > </init-param> >> > >> > in my web.xml. >> > >> > Regards, >> > >> > Pierre >> > >> > On Wed, Aug 8, 2012 at 5:43 PM, Pierre Goupil >> > <[email protected]>wrote: >> > > Good afternoon, >> > > >> > > I'm currently trying and have wicket-atmosphere work. I've looked at the >> > > examples and I'm unable to post a message because of this exception: >> > > >> > > >> > > INFO - EventBus - registering component for page 0 for >> > > session 971E81ED0E61970FA35A1B03E5B218F8: >> > > ERROR - DefaultExceptionMapper - Unexpected error occurred >> > > java.lang.IllegalStateException: Request#getLocale() cannot return null, >> > > request has to have a locale set on it >> > > >> > > at org.apache.wicket.Session.<init>(Session.java:211) >> > > at >> > > >> > > org.apache.wicket.protocol.http.WebSession.<init>(WebSession.java:92) >> > > >> > > at >> > > >> > > org.apache.wicket.protocol.http.WebApplication.newSession(WebApplication.j >> > > ava:536)> >> > > at >> > > >> > > org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:15 >> > > 57)> >> > > at org.apache.wicket.Session.get(Session.java:152) >> > > at >> > > >> > > org.apache.wicket.RestartResponseAtInterceptPageException$InterceptData.ge >> > > t(RestartResponseAtInterceptPageException.java:146)> >> > > at >> > > >> > > org.apache.wicket.RestartResponseAtInterceptPageException$1.matchedData(Re >> > > startResponseAtInterceptPageException.java:211)> >> > > at >> > > >> > > org.apache.wicket.RestartResponseAtInterceptPageException$1.getCompatibili >> > > tyScore(RestartResponseAtInterceptPageException.java:179)> >> > > at >> > > >> > > org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(Compound >> > > RequestMapper.java:134)> >> > > at >> > > >> > > org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(Request >> > > Cycle.java:182)> >> > > at >> > > >> > > org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.j >> > > ava:207)> >> > > at >> > > >> > > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(Reque >> > > stCycle.java:281)> >> > > at >> > > >> > > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.j >> > > ava:188)> >> > > at >> > > >> > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:24 >> > > 5)> >> > > at >> > > >> > > org.atmosphere.util.AtmosphereFilterChain.doFilter(AtmosphereFilterChain.j >> > > ava:154)> >> > > at >> > > >> > > org.atmosphere.util.AtmosphereFilterChain.invokeFilterChain(AtmosphereFilt >> > > erChain.java:131)> >> > > at >> > > >> > > org.atmosphere.handler.ReflectorServletProcessor$FilterChainServletWrapper >> > > .service(ReflectorServletProcessor.java:310)> >> > > at >> > > >> > > org.atmosphere.handler.ReflectorServletProcessor.onRequest(ReflectorServle >> > > tProcessor.java:168)> >> > > at >> > > >> > > org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java >> > > :248)> >> > > at >> > > >> > > org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.j >> > > ava:166)> >> > > at >> > > >> > > org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil >> > > .java:120)> >> > > at >> > > >> > > org.atmosphere.container.Tomcat7BIOSupportWithWebSocket.service(Tomcat7BIO >> > > SupportWithWebSocket.java:57)> >> > > at >> > > >> > > org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework. >> > > java:1222)> >> > > at >> > > >> > > org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.ja >> > > va:187)> >> > > at >> > > >> > > org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.ja >> > > va:116)> >> > > at >> > > >> > > org.atmosphere.container.TomcatWebSocketHandler.onOpen(TomcatWebSocketHand >> > > ler.java:58)> >> > > at >> > > >> > > org.apache.catalina.websocket.StreamInbound.onUpgradeComplete(StreamInboun >> > > d.java:228)> >> > > at >> > > >> > > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstr >> > > actProtocol.java:593)> >> > > at >> > > >> > > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.jav >> > > a:310)> >> > > at >> > > >> > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: >> > > 1110)> >> > > at >> > > >> > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java >> > > :603)> >> > > at java.lang.Thread.run(Thread.java:679) >> > > >> > > My code is pretty straight-forward, but just in case, here is the >> > > Application: >> > > >> > > @Override >> > > >> > > public void init() >> > > { >> > > >> > > super.init(); >> > > >> > > eventBus = new EventBus(this); >> > > >> > > ScheduledExecutorService scheduler = >> > > >> > > Executors.newScheduledThreadPool(1); >> > > >> > > final Runnable beeper = new Runnable() >> > > { >> > > >> > > @Override >> > > public void run() >> > > { >> > > >> > > try >> > > { >> > > >> > > eventBus.post(new Date()); >> > > >> > > } >> > > catch (Exception e) >> > > { >> > > >> > > e.printStackTrace(); >> > > >> > > } >> > > >> > > } >> > > >> > > }; >> > > scheduler.scheduleWithFixedDelay(beeper, 2, 2, TimeUnit.SECONDS); >> > > >> > > } >> > > >> > > >> > > >> > > >> > > And here is the code that should trigger but that doesn't: >> > > >> > > public HomePage(final PageParameters parameters) >> > > >> > > { >> > > >> > > super(parameters); >> > > >> > > timeLabel = new Label("version", Model.of("-")); >> > > timeLabel.setOutputMarkupId(true); >> > > add(timeLabel); >> > > >> > > } >> > > >> > > @Subscribe >> > > public void updateTime(AjaxRequestTarget target, Date event) >> > > { >> > > >> > > timeLabel.setDefaultModelObject(event.toString()); >> > > target.add(timeLabel); >> > > >> > > } >> > > >> > > I'm using Wicket-6.0.0-beta3 and its wicket-atmosphere 0.2. >> > > >> > > Thanks in advance, >> > > >> > > Pierre >> > > >> > > >> > > >> > > >> > > -- >> > > Le bonheur n'est pas une destination, mais une façon de voyager. >> > > >> > > Papa d'une petite Lou-Ann depuis le 30 juin. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > > -- > Le bonheur n'est pas une destination, mais une façon de voyager. > > Papa d'une petite Lou-Ann depuis le 30 juin. > -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
