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



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




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


      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 Fri Jun 7 15:16:15 PDT 2013 1530982 WLS_12.

      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


      ajaxRequest.responseText == ""


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


      <"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:












        • 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:


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


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


          <"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"))) {


            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:



            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.