Apache Tomcat what Version and Features necessary for @Push

Hello Forum and Tomcat-Specialists,

I have problems with a Vaadin application that uses @Push.

I´m using @Push succesfull on a localhost-server application that grows.

The local application can be reached successfully in the local network and from outside via exposed host from outside.

But I have problems to use it on a VPS site.

For testing it in a smaller scale I opened a small Vaadin project I had exported as WAR to a provider for testing.

Following Vaadin Configuration:

  • I created the base application “Hello World” for testing with Vaadin 7.1.11. with Apache 7.0.28

  • I configured web.xml with Servlet 3.0 and async-support:

<?xml version="1.0" encoding="UTF-8"?>

<web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>HelloWorld8</display-name>
    <context-param>
        <description>
        Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Helloworld8Application</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <init-param>
            <description>
            Vaadin UI class to use</description>
            <param-name>UI</param-name>
            <param-value>com.example.helloworld8.Helloworld8UI</param-value>
        </init-param>
        
        <async-supported>true</async-supported>
        
    </servlet>
    <servlet-mapping>
        <servlet-name>Helloworld8Application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>

The UI is modified with PUSH:

package com.example.helloworld8;

import com.vaadin.annotations.Push;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings("serial")
@Push
public class Helloworld8UI extends UI {

    @Override
    protected void init(VaadinRequest request) {
        final VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        setContent(layout);

        Button button = new Button("Click Me");
        button.addClickListener(new Button.ClickListener() {
            public void buttonClick(ClickEvent event) {
                layout.addComponent(new Label("Thank you for clicking"));
            }
        });
        layout.addComponent(button);
    }

}

Using this configuration on a separated Apache runtime 7.0.28 (not via Eclipse) I can use the
application in the local network or reaching it from outside via exposed host through the router (fritz.box).


Using this application with Apache 7.0.28 hoste on VPS provider site it doesn´t work:

The application can be started but after clicking the button the waiting indicator is shown forever and nothing happens…

I dont get it running and I´m not a server specialist.

Following configuraton runs my provider:

Apache Tomcat/7.0.28

JVM 1.7.0_17-b02 Oracle Corporation

Linux 2.6.26-2-amd64

[b]
What Apache Tomcat Features are necessary to get it running?

What configuriatons on the Tomcat are necessary?
[/b]

The provider allows me to deploy and run the WARs via Tomcat Web Application Manager.

When I talk to the support there, they only know their server stuff things from an abstract niveau.

I only can tell them: Ok, I want to get a Web-Java-Application getting run that generates HTML, Java-Script etc.

What information do I need to give them so that they know what is to do?

Greetings

Alex

This may well be an issue with a proxy server controlled by your ISP that is not compatible with Vaadin’s push implementation; unfortunately it might be there’s nothing you can do about it. The two mechanisms supported by Vaadin - websocket and http streaming - both have issues with certain proxies, although for different reasons. The long polling mechanism added in Vaadin 7.2 will hopefully improve proxy compatibility. In the meantime, you might want to try polling; please check out the UI.setPollInterval method.