Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It doesn't seems to work with Vaadin 7.4.4 #3

Open
ducciovigolo opened this issue Apr 28, 2015 · 7 comments
Open

It doesn't seems to work with Vaadin 7.4.4 #3

ducciovigolo opened this issue Apr 28, 2015 · 7 comments

Comments

@ducciovigolo
Copy link

even the ICEPushDemo example of branch 7 seems to be broken: the call pusher.push() doesn't work because is not invoked from a session.lock() block

@Artur-
Copy link
Owner

Artur- commented Apr 28, 2015

I have not updated ICEPush in a long time since there is push support included in the framework since 7.1. Any particular reason you don't use that?

@ducciovigolo
Copy link
Author

Hi Artur,
we had some troubles with Push configurations (using LONG POLLING) and while trying to address that issues we also observed some problems with Spring Security and the STREAMING transport. Petter Holmström confirmed that Push still has some problems (see also peholmst/vaadin4spring#209) and suggested to me to use CLIENT POLLING as Push can't be considered production ready yet. Our problem is that we are actually in production and we also like to avoid all the issues listed in this document: https://vaadin.com/wiki/-/wiki/Main/Configuring+push+for+your+environment, because our application is typically installed on different environments/application server
Before giving up with the Push solution and switching to CLIENT POLLING I was wondering if your addon could represent a viable workaround.
Duccio
P.S. if you're interested to the details of our issues with LONG POLLING and STREAMING I could give you the analysis document that I sent to Petter.

@Artur-
Copy link
Owner

Artur- commented Apr 29, 2015

I updated the demo to use 7.4.4 and it seems to work fine as long as you call push() when you have the session locked.

I got your document from Petter, thanks. I'll look through it. If you are not using the latest 7.4, you should upgrade. There are several push fixes done in the 7.4 series.

@ducciovigolo
Copy link
Author

Ok Artur, I'll give it a try. We are actually using Vaadin 7.4.4.
Please find the requested document here:
it could be a little cumbersome, but I hope it could at least give you some hint...

@ducciovigolo
Copy link
Author

Hi Artur, unfortunately I still have problems: this is my class...

package com.example.vaadin_icepush;

import java.util.logging.Logger;

import javax.servlet.annotation.WebServlet;

import org.vaadin.artur.icepush.ICEPush;
import org.vaadin.artur.icepush.ICEPushServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
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")
@Theme("vaadin_icepush")
public class Vaadin_icepushUI extends UI {

    private final ICEPush icePush;
    private VerticalLayout layout;

    @WebServlet(value = "/*", asyncSupported = true)
    @VaadinServletConfiguration(productionMode = false, ui = Vaadin_icepushUI.class, widgetset="com.example.vaadin_icepush.widgetset.Vaadin_icepushWidgetset")
    public static class Servlet extends ICEPushServlet {
    }

    public Vaadin_icepushUI() {
        icePush = new ICEPush();
    }

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

        Button button = new Button("Do stuff in the background");
        button.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                Logger logger = Logger.getLogger(getClass().getName());
                logger.info("button clicked");
                layout.addComponent(new Label("waiting for background process to complete..."));
                new BackgroundThread(UI.getCurrent()).start();
            }
        });
        layout.addComponent(button);
    }

    public class BackgroundThread extends Thread {
        private final UI ui;

        public BackgroundThread(UI ui) {
            this.ui = ui;
        }

        @Override
        public void run() {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
            }

            ui.access(new Runnable() {
                @Override
                public void run() {
                    Logger logger = Logger.getLogger(getClass().getName());
                    logger.info("job done, now updating the the UI and pushing...");
                    layout.addComponent(new Label("All done"));
                    icePush.push();
                }
            });
        }
    }
}

and this is the log from my tomcat 7.0.61 (see the request's details below):
Apr 29, 2015 11:43:21 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:vaadin-icepush' did not find a matching property.
Apr 29, 2015 11:43:21 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Apr 29, 2015 11:43:21 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8180"]
Apr 29, 2015 11:43:21 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8109"]
Apr 29, 2015 11:43:21 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 594 ms
Apr 29, 2015 11:43:21 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 29, 2015 11:43:21 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.61
Apr 29, 2015 11:43:23 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8180"]
Apr 29, 2015 11:43:23 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8109"]
Apr 29, 2015 11:43:23 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1764 ms
Apr 29, 2015 11:43:28 AM com.vaadin.server.DefaultDeploymentConfiguration checkProductionMode

WARNING:

Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.

To show debug window, add ?debug to your application URL.

Apr 29, 2015 11:43:28 AM org.icepush.servlet.MainServlet
INFO:
ICEsoft Technologies Inc.
ICEpush 0.0.1 Development
Build number: xxx
Revision: ${revision}

Apr 29, 2015 11:43:30 AM org.icepush.servlet.EnvironmentAdaptingServlet
INFO: Adapting to Servlet 3.0 AsyncContext environment
Apr 29, 2015 11:43:30 AM org.icepush.servlet.AsyncAdaptingServlet
INFO: Using Servlet 3.0 AsyncContext
Apr 29, 2015 11:43:33 AM com.example.vaadin_icepush.Vaadin_icepushUI$1 buttonClick
INFO: button clicked
Apr 29, 2015 11:43:38 AM com.example.vaadin_icepush.Vaadin_icepushUI$BackgroundThread$1 run
INFO: job done, now updating the the UI and pushing...
Apr 29, 2015 11:43:52 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [com.example.vaadin_icepush.Vaadin_icepushUI$Servlet] in context with path [/vaadin-icepush] threw exception
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:192)
at org.icepush.BlockingConnectionServer.access$300(BlockingConnectionServer.java:48)
at org.icepush.BlockingConnectionServer$3.service(BlockingConnectionServer.java:95)
at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:135)
at org.icepush.servlet.AsyncAdaptingServlet.service(AsyncAdaptingServlet.java:47)
at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:51)
at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:111)
at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:50)
at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
at org.icepush.servlet.MainServlet.service(MainServlet.java:71)
at org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:62)
... 21 more
Caused by: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.apache.catalina.core.AsyncContextImpl.check(AsyncContextImpl.java:557)
at org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:92)
at org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66)
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:190)
... 32 more

Apr 29, 2015 11:44:02 AM com.example.vaadin_icepush.Vaadin_icepushUI$1 buttonClick
INFO: button clicked
Apr 29, 2015 11:44:07 AM com.example.vaadin_icepush.Vaadin_icepushUI$BackgroundThread$1 run
INFO: job done, now updating the the UI and pushing...
Apr 29, 2015 11:44:18 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [com.example.vaadin_icepush.Vaadin_icepushUI$Servlet] in context with path [/vaadin-icepush] threw exception
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:192)
at org.icepush.BlockingConnectionServer.access$300(BlockingConnectionServer.java:48)
at org.icepush.BlockingConnectionServer$3.service(BlockingConnectionServer.java:95)
at org.icepush.BlockingConnectionServer.service(BlockingConnectionServer.java:135)
at org.icepush.servlet.AsyncAdaptingServlet.service(AsyncAdaptingServlet.java:47)
at org.icepush.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:51)
at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
at org.icepush.servlet.BrowserDispatcher$BrowserEntry.service(BrowserDispatcher.java:111)
at org.icepush.servlet.BrowserDispatcher.service(BrowserDispatcher.java:50)
at org.icepush.servlet.PathDispatcher.service(PathDispatcher.java:45)
at org.icepush.servlet.MainServlet.service(MainServlet.java:71)
at org.vaadin.artur.icepush.ICEPushServlet.service(ICEPushServlet.java:62)
... 21 more
Caused by: java.lang.IllegalStateException: The request associated with the AsyncContext has already completed processing.
at org.apache.catalina.core.AsyncContextImpl.check(AsyncContextImpl.java:557)
at org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:92)
at org.icepush.servlet.AsyncAdaptingServlet$AsyncRequestResponse.respondWith(AsyncAdaptingServlet.java:66)
at org.icepush.BlockingConnectionServer.respondIfPendingRequest(BlockingConnectionServer.java:190)
... 32 more

the exception seems to be thrown at the end of these requests:
POST http://localhost:8180/vaadin-icepush/listen.icepush

Request Headers:

Host: localhost:8180
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
ice.push.window: c7cbb
Referer: http://localhost:8180/vaadin-icepush/
Content-Length: 27
Cookie: JSESSIONID=7A218A551C6113C04A6ED2ED2E3C88E1; ice.connection.lease=1430301305366; ice.connection.contextpath=undefined; ice.notified.pushids=; ice.push.browser=2i92iscq0; ice.pushids=2i92iscq0:3ivf; ice.connection.running=c7cbb:acquired
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

Body:

ice.pushid=2i92iscq0%3A3ivf

@azekool
Copy link

azekool commented Dec 10, 2015

Hi Arthur, I am using ICE-PUSH addon for a while. It was working fine for my requirement.
I always update the Vaadin release as soon as I can, so I am currently using Vaadin 7.5.9.

I am not sure where it lies, but recently, I get the push notification updated only on the mouse move.
i.e. if I update a label via ICE-Push, the updated text appears only if we move the mouse over Vaadin application.
If mouse is on another application/window, the changes doesn't appear.

I am pretty sure It was not the case at the beginning. I started Vaadin using 7.1.x.

Once I change the configuration to use the native Vaadin Push It this phenomena was not there.

I am not sure what makes this update delayed. could you please help me in this regard

@Artur-
Copy link
Owner

Artur- commented Dec 10, 2015

@azekool Moved your issue to #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants