Vaadin CDI + Wildfly + Push

I’m using Vaadin 7.3.0 and CDI addon latest snapshot (builded from source from github). In my project don’t use Push and I don’t even have dependency to vaadin-push. Everything is working as expected, but when I leave application in idle state for some time, I get exception:

2014-09-07 17:55:17,174 ERROR [stderr] (default task-32) Exception in thread "default task-32" java.lang.NullPointerException 2014-09-07 17:55:17,177 ERROR [stderr] (default task-32) at org.apache.deltaspike.core.util.context.AbstractContext.get( 2014-09-07 17:55:17,178 ERROR [stderr] (default task-32) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance( 2014-09-07 17:55:17,179 ERROR [stderr] (default task-32) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke( 2014-09-07 17:55:17,180 ERROR [stderr] (default task-32) at com.zipsoft.ekarton.ui.MainUI$Proxy$_$$_WeldClientProxy.getPushConfiguration(Unknown Source) 2014-09-07 17:55:17,181 ERROR [stderr] (default task-32) at com.vaadin.server.VaadinSession.unlock( 2014-09-07 17:55:17,182 ERROR [stderr] (default task-32) at com.vaadin.server.VaadinSession.accessSynchronously( 2014-09-07 17:55:17,183 ERROR [stderr] (default task-32) at com.vaadin.server.VaadinService.fireSessionDestroy( 2014-09-07 17:55:17,184 ERROR [stderr] (default task-32) at com.vaadin.server.VaadinSession.valueUnbound( 2014-09-07 17:55:17,185 ERROR [stderr] (default task-32) at io.undertow.servlet.core.SessionListenerBridge.attributeRemoved( 2014-09-07 17:55:17,186 ERROR [stderr] (default task-32) at io.undertow.server.session.SessionListeners.attributeRemoved( 2014-09-07 17:55:17,187 ERROR [stderr] (default task-32) at io.undertow.server.session.InMemorySessionManager$SessionImpl.removeAttribute( 2014-09-07 17:55:17,188 ERROR [stderr] (default task-32) at io.undertow.servlet.core.SessionListenerBridge.sessionDestroyed( 2014-09-07 17:55:17,189 ERROR [stderr] (default task-32) at io.undertow.server.session.SessionListeners.sessionDestroyed( 2014-09-07 17:55:17,190 ERROR [stderr] (default task-32) at io.undertow.server.session.InMemorySessionManager$SessionImpl.invalidate( 2014-09-07 17:55:17,190 ERROR [stderr] (default task-32) at io.undertow.server.session.InMemorySessionManager$SessionImpl$1$ 2014-09-07 17:55:17,190 ERROR [stderr] (default task-32) at java.util.concurrent.ThreadPoolExecutor.runWorker( 2014-09-07 17:55:17,191 ERROR [stderr] (default task-32) at java.util.concurrent.ThreadPoolExecutor$ 2014-09-07 17:55:17,191 ERROR [stderr] (default task-32) at When I add vaadin-push dependency, everything is fine. So that is an easy fix.

Then I decided to try using push. Application was working normaly, but when I close browser tab or refresh page I get this exception:

2014-09-07 18:29:50,416 SEVERE [org.atmosphere.container.JSR356Endpoint]
(default I/O-4) : java.nio.channels.ClosedChannelException
at io.undertow.server.protocol.framed.AbstractFramedChannel.receive(
at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(
at io.undertow.websockets.core.AbstractReceiveListener.handleEvent(
at org.xnio.ChannelListeners.invokeChannelListener( [xnio-api-3.2.2.Final.jar:3.2.2.Final]

at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(
at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(
at org.xnio.ChannelListeners.invokeChannelListener( [xnio-api-3.2.2.Final.jar:3.2.2.Final]

at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady( [xnio-api-3.2.2.Final.jar:3.2.2.Final]

at org.xnio.nio.NioSocketConduit.handleReady( [xnio-nio-3.2.2.Final.jar:3.2.2.Final]

at [xnio-nio-3.2.2.Final.jar:3.2.2.Final]

[/code]I trace this to I have compared atmosphere fixed source with vaadin version of atmosphere frameowork and the fix is applied. From there, I trace exception to and it was resolved in undertow versions 1.0.4.Final, 1.1.Beta1. Wildfly 8.1.0 is using undertow version 1.0.15.Final, so the fix should be included.

When I switch transport mode tolong pooling, I don’t get any exception, but I get this in debug console "SEVERE: No active request " and “Session expired” message.

Am I missing something?

I recompile widgetset and and long-polling now work as expected.

I have furder investigated websocket issue and it seems that this is wildfly/undertow issue and has nothing to do with Vaadin or atmosphere.

Thanks for looking into this. I hope it gets fixed on the Wildfly side.

Here is link to the Wildfly issue