3 Replies Latest reply on Jun 16, 2014 9:21 PM by Val Blant

    <a4j:push /> works on Tomcat 7, but not Weblogic 12c

    Val Blant Newbie

      Greetings,

       

      I've been trying to figure out why this does not work, and I am out of ideas, so I could use some help.

       

      Page.xhtml:

       

      <a4j:push address="systemLinks" >
        <a4j:ajax event="dataavailable" render="systemLinksPanel" />
      </a4j:push>
      
      <a4j:outputPanel id="systemLinksPanel">
           stuff here
      </a4j:outputPanel>
      
      

       

      Startup log:

      INFO: Installed AtmosphereHandler org.atmosphere.handler.ReflectorServletProcessor mapped to context-path: /*

      INFO: Atmosphere is using async support: org.atmosphere.container.Servlet30CometSupport running under container:

      WebLogic Server 12.1.2.0.0 Fri Jun 7 15:16:15 PDT 2013 1530982 WLS_12.1.2.0.0_GENERIC_130607.1100

      Oracle WebLogic Server Module Dependencies 12.1 Tue May 21 06:02:40 PDT 2013  using javax.servlet/3.0

      INFO: Installing Filter PushHandlerFilter

      INFO: Using broadcaster class: org.atmosphere.cpr.DefaultBroadcaster

       

       

      Java code:

       

      TopicKey topicKey = new TopicKey("systemLinks");
      TopicsContext topicsContext = TopicsContext.lookup();
      topicsContext.publish(topicKey, "fly, you fools!");
      
      

       

      On Tomcat 7 this work perfectly, and always refreshes 'systemLinksPanel' when data is published.

       

      On Weblogic 12c, I am pretty sure the response is sent, but it is never received by the client 'XMLHttpRequest'. What I mean by that is that

      ajaxRequest.readyState == 4

      But

      ajaxRequest.responseText == ""

       

      So no events are triggered. I have examined the exchange with a network protocol analyzer, and I do see the response:

      003b

      <"topic":"systemLinks","data":"fly, you fools!","number":0>

       

      Now I don't know where else to look. The data leaves the server, but does not arrive at the destination. What else can I check?

       

      The only difference I see in the response from Tomcat is that the two leading zeros are not there. So '3b' instead of '003b'.

       

      Library Versions:

      richfaces-components-api-4.2.0.Final.jar

      richfaces-components-ui-4.2.0.Final.jar

      richfaces-core-api-4.2.0.Final.jar

      richfaces-core-impl-4.2.0.Final.jar

      javax.faces-2.1.7.jar

      atmosphere-compat-jbossweb-0.8.4.jar

      atmosphere-compat-jetty-0.8.4.jar

      atmosphere-compat-tomcat-0.8.4.jar

      atmosphere-compat-tomcat7-0.8.4.jar

      atmosphere-compat-weblogic-0.8.4.jar

      atmosphere-runtime-0.8.4.jar

        • 1. Re: <a4j:push /> works on Tomcat 7, but not Weblogic 12c
          Val Blant Newbie

          I just found something useful.

           

          I was able to get the data returned properly to the browser, by setting some breakpoints inside Atmposphere code after the message is flushed into the Writer. I found that if I allow the request to time out w/o completing the thread that flushed the writer, the response looks as follows and everything works:

          003b

          <"topic":"systemLinks","data":"fly, you fools!","number":0>

          0000

          However, if I allow the flushing thread to continue right away, the response looks like this and the browser never receives the data:

          003b

          <"topic":"systemLinks","data":"fly, you fools!","number":0>

          Note the missing terminating zero.

          • 2. Re: Re: <a4j:push /> works on Tomcat 7, but not Weblogic 12c
            Val Blant Newbie

            ok, getting closer I think.

             

            The offending line that cause the response to be terminated incorrectly in Weblogic is:

             

            Servlet30CometSupport.action(AtmosphereResourceImpl actionEvent) {
            ....
            
                        if (asyncContext != null && (config.getInitParameter(ApplicationConfig.RESUME_AND_KEEPALIVE) == null
                                || config.getInitParameter(ApplicationConfig.RESUME_AND_KEEPALIVE).equalsIgnoreCase("false"))) {
                            asyncContext.complete();
                        }
            
            ....
            }
            

             

            As long as I allow the request to timeout w/o executing that line, everything works fine.

             

            To verify this I added the following to my servlet definition:

               <init-param>
                   <param-name>org.atmosphere.cpr.AtmosphereServlet.resumeAndKeepAlive</param-name>
                   <param-value>true</param-value>
               </init-param>
            

             

            Now the pushed data is correct, but it does not come back until the request times out, so it's not immediate.

             

            Did anyone else have this problem? I am still not sure what the correct fix for this might be.

            • 3. Re: <a4j:push /> works on Tomcat 7, but not Weblogic 12c
              Val Blant Newbie

              The root cause and a workaround are described here: https://issues.jboss.org/browse/RF-13674