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 <goupilpie...@gmail.com>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.java:536)
>     at
> org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:1557)
>     at org.apache.wicket.Session.get(Session.java:152)
>     at
> org.apache.wicket.RestartResponseAtInterceptPageException$InterceptData.get(RestartResponseAtInterceptPageException.java:146)
>     at
> org.apache.wicket.RestartResponseAtInterceptPageException$1.matchedData(RestartResponseAtInterceptPageException.java:211)
>     at
> org.apache.wicket.RestartResponseAtInterceptPageException$1.getCompatibilityScore(RestartResponseAtInterceptPageException.java:179)
>     at
> org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:134)
>     at
> org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:182)
>     at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:207)
>     at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
>     at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
>     at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
>     at
> org.atmosphere.util.AtmosphereFilterChain.doFilter(AtmosphereFilterChain.java:154)
>     at
> org.atmosphere.util.AtmosphereFilterChain.invokeFilterChain(AtmosphereFilterChain.java:131)
>     at
> org.atmosphere.handler.ReflectorServletProcessor$FilterChainServletWrapper.service(ReflectorServletProcessor.java:310)
>     at
> org.atmosphere.handler.ReflectorServletProcessor.onRequest(ReflectorServletProcessor.java:168)
>     at
> org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:248)
>     at
> org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166)
>     at
> org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:120)
>     at
> org.atmosphere.container.Tomcat7BIOSupportWithWebSocket.service(Tomcat7BIOSupportWithWebSocket.java:57)
>     at
> org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1222)
>     at
> org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:187)
>     at
> org.atmosphere.websocket.WebSocketProcessor.dispatch(WebSocketProcessor.java:116)
>     at
> org.atmosphere.container.TomcatWebSocketHandler.onOpen(TomcatWebSocketHandler.java:58)
>     at
> org.apache.catalina.websocket.StreamInbound.onUpgradeComplete(StreamInbound.java:228)
>     at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:593)
>     at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java: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.
>
>


-- 
Le bonheur n'est pas une destination, mais une façon de voyager.

Papa d'une petite Lou-Ann depuis le 30 juin.

Reply via email to