Push not working with Jetty?

Hi everyone,

I already tried some Push in tomcat and it works fine.
But it seems that jetty is not running it.

Is there any bug report?

What version of Jetty are you using? What version of Vaadin are you using? What kind of problem are you seeing?

Ok, sorry,

Vaadin: 7.3.1
Jetty: tried in 6, 8 and 9 last versions, and running on Maven plugin.

2014-10-01 10:44:19.431:WARN::/pluris-server-vaadin/a/PUSH/

com.vaadin.server.ServiceException: org.mortbay.jetty.RetryRequest

    at com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1460)

    at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1414)

    at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)

    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)

Joao-

I had some problems initially but found out along the way that the old Jetty does not work well with Push. Also, it looks like you are still using the old Jetty versions based on your error messages. I believe that the Vaadin core uses an old version of Jetty and if you are using Ivy, you have to exclude that out of your download for it to work (or at lease that’s what it seems like what I had to do a couple of months ago).

<dependency org="com.vaadin" name="vaadin-client-compiler" rev="&vaadin.version;" conf="widgetset-compile->default" > <exclude org="org.eclipse.jetty" name="jetty-annotations"/> <exclude org="org.eclipse.jetty" name="jetty-servlet"/> <exclude org="org.eclipse.jetty" name="jetty-servlets"/> <exclude org="org.eclipse.jetty" name="jetty-util"/> <exclude org="org.eclipse.jetty" name="jetty-security"/> <exclude org="org.eclipse.jetty" name="jetty-plus"/> <exclude org="org.eclipse.jetty" name="jetty-webapp"/> <exclude org="org.eclipse.jetty" name="jetty-xml"/> <exclude org="org.eclipse.jetty" name="jetty-server"/> <exclude org="org.eclipse.jetty" name="jetty-continuation"/> <exclude org="org.eclipse.jetty" name="jetty-http"/> <exclude org="org.eclipse.jetty" name="jetty-io"/> <exclude org="org.eclipse.jetty" name="jetty-jndi"/> <exclude org="org.eclipse.jetty" name="jetty-client"/> </dependency> Once I added this to my Ivy configuration, cleaned all cache, recompiled the widgetset, and reconfigured my server logic to use the new Jetty version, everything seemed to work fine.

For Jetty 9, they have some good examples on how to setup your web server the way you want at:

http://www.eclipse.org/jetty/documentation/current/embedded-examples.html#d0e18552

I hope this helps you out.

Best Regards,
Eric

Thanks Eric, you gave me some lights,

I not using vaadin-client-compiler, is it necessary to use Push?
Or you told me just in case I was using it?
Or is there other vaadin dependency that uses jetty?

Ok, Push is working now that I changed Jetty version to 8.1.16.v20140903.
But Spring is in conflict, it says my session beans are out of reach, and I am using SpringVaadinIntegration.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'passportCommandInvoker': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request. and

Caused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

It is not because of Jetty version, as I thought earlier, it is because of the Push.

Ok, found it has to do with Spring Session Scope, I am using VaadinSpringIntegration addon, and this looks like to be a big issue in the forum: Session + Push.