Websocket Primefaces Push doesn't work on IE8 because of CDI

UI Components for JSF
Post Reply
kolingo
Posts: 3
Joined: 10 Mar 2014, 14:44

08 Oct 2014, 13:38

Hi,

I have to deal with a very strange problem which I just don't understand:

I have a J2EE Application running on Glassfish 4 with Primefaces 5. So I wanted to test the Primefaces Push and started with the counter example from the Primefaces showcase page (http://www.primefaces.org/showcase/push/counter.xhtml).

Showcase works fine on all browsers including IE8 (with the long-polling fallback). But I had a problem with the IE8 on my server, it just did't work.

After several hours of digging I found out that my CDI Conversation Filter, which I have declared in my web.xml:

Code: Select all

<filter>
    <filter-name>ca3HttpFilter</filter-name>
    <filter-class>ch.carauktion.general.ui.filter.CA3HttpFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>ca3HttpFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>CDI Conversation Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
somehow makes the push broken: the request from IE8 reaches the server and e.g. Chrome client gets the push, but IE8 doesn't get it... If the server runs without that filter everything works as in showcase.

The filter makes nothing except of handling a NonexistentConversationException:

Code: Select all

public class CA3HttpFilter implements Filter {

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    try {
        chain.doFilter(request, response);

    } catch (NonexistentConversationException e) {
        onNonexistingConversationException(e, request, response);
    }
}
...
}
Can anybody help me to understand this strange issue?

Thanks!

----------------------
Dependencies:
  • glassfish-embedded 4.0.1-SNAPSHOT with mojarra jsf 2.2.4
    primefaces 5.1
    atmosphere-runtime 2.2.2

kolingo
Posts: 3
Joined: 10 Mar 2014, 14:44

14 Oct 2014, 19:47

A new issue concerning this matter was published on Primefaces Issues Tracker: https://code.google.com/p/primefaces/is ... 1413308380

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

15 Oct 2014, 23:29

Maybe because ie8 uses a different 'push' mechanism as the others (e.g. long polling instead of websockets) try what haplens if you use long polling for other browsers to if the mechanism is different)

kolingo
Posts: 3
Joined: 10 Mar 2014, 14:44

16 Oct 2014, 10:55

Yes, you are right, Atmosphere framework, which is used by Primefaces push, have a default fallback for old browsers which do not support websockets, and it is long polling. So to be more exact the problem is that long polling doesn't work on IE8 because of CDI Filter. But still it is strange and I just don't understand what exactly makes a CDI filter that there is no push on IE8...

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

16 Oct 2014, 13:22

Maybe it blocks some e.g. atmosphere param, or the other way around, the long polling request does not contain a conversation id param, or... whatever... Better ask this in the atmosphere forum

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests