5 Replies Latest reply on Nov 28, 2008 1:23 PM by nbelaevski

    RichFaces elements not working after Tomcat-Apache conn

    terron

      Hello,

      sorry, I posted the same issue in the "RichFaces developers". If an admin can delete that entry...

      I have an application running on Tomcat, and I was using the Tomcat HTTP functionality (Coyote) until, because of requirements I cannot avoid, I connected Tomcat to Apache.

      I am using Tomcat 6 and Apache 2.0.59.
      The connector is the mod_jk2, because I used that in other cases and it did what it had to do. (meanwhile I also try with the recommended mod_jk with no better result)

      All looks fine, instead of using http://myServer.com:8080/myApp
      I use http://myServer.com/myApp
      and all seems to work fine...

      until I come to the RichFaces elements suggestionbox or modalPanel . No suggestionbox nor modalPanel is appearing !

      rich:dataTable works
      and even Ajax4JSF functionality like a4j:support works well. So, it cannot be the ajax request, can it?

      In the same server and same application, if I use Tomcat without the connector (direct with port 8080) those failing RichFaces elements work 100%.

      Any idea welcome!

      Thanks!

        • 1. Re: RichFaces elements not working after Tomcat-Apache conn
          terron

          may give these log-outputs some hints to people who understand them well.

          Any help is appreciated!

          ########### with tomcat standalone (working) ########################################################


          /MyApp/faces/a4j.res/org/richfaces/renderkit/html/scripts/suggestionbox.js

          20:27:06,453 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'backBean' in via original VariableResolver
          20:27:06,453 DEBUG AjaxContext:428 - Styles for insert into head :
          /MyApp/faces/a4j.res/org/richfaces/renderkit/html/css/suggestionbox.xcss/DATA/eAFbJaehBAADeAET

          20:27:06,453 DEBUG AjaxPhaseListener:72 - Process after phase RENDER_RESPONSE 6
          20:27:06,453 DEBUG FilterServletResponseWrapper:232 - Create StringWriter for buffer servlet output
          20:27:06,453 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          20:27:06,453 DEBUG RendererBase:96 - Start encoding of component _viewRoot with class org.ajax4jsf.framework.ajax.AjaxViewRoot
          20:27:06,468 DEBUG BaseXMLFilter:188 - Process response to well-formed XML for AJAX XMLHttpRequest parser
          20:27:06,468 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          20:27:06,468 DEBUG TidyXMLFilter:81 - Parsers pool empty - create new JTidy parser
          20:27:06,468 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          20:27:06,468 DEBUG TidyParser:216 - Message for HTML parsing : img lacks "alt" attribute
          20:27:06,468 DEBUG TidyParser:216 - Message for HTML parsing : missing <!DOCTYPE> declaration
          20:27:06,468 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          20:27:06,468 DEBUG TidyParser:216 - Message for HTML parsing : inserting missing 'title' element
          20:27:06,468 DEBUG TidyParser:216 - Message for HTML parsing : meta isn't allowed in <body> elements
          20:27:06,468 DEBUG AjaxContainerRenderer:112 - AjaxView RenderChildren() components for AJAX request
          20:27:06,484 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          20:27:06,484 DEBUG AjaxRendererUtils:616 - Calculate absolute ID for component _viewRoot as :_viewRoot
          20:27:06,484 DEBUG TidyParser:216 - Message for HTML parsing : meta isn't allowed in <body> elements
          20:27:06,484 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID _viewRoot
          20:27:06,484 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID j_id494
          20:27:06,484 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID j_id495
          20:27:06,484 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID j_id496
          20:27:06,484 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID j_id497
          20:27:06,484 DEBUG BaseXMLFilter:274 - Parsing html total time 16ms
          20:27:06,500 DEBUG AjaxChildrenRenderer:88 - AjaxView encodeChild component for AJAX request with at path : ID laForm
          20:27:06,500 DEBUG BaseFilter:298 - Finished request processing total time 485ms for uri: /MyApp/faces/pgs/sect/SecOne.xhtml

          ###########################################################################################

          ########### with tomcat behind apache (not working) ###########################################

          /MyApp/faces/a4j.res/org/richfaces/renderkit/html/scripts/suggestionbox.js

          19:27:18,248 DEBUG AjaxContext:428 - Styles for insert into head :
          /MyApp/faces/a4j.res/org/richfaces/renderkit/html/css/suggestionbox.xcss/DATA/eAFbJaehBAADeAET

          19:27:18,248 DEBUG AjaxPhaseListener:72 - Process after phase RENDER_RESPONSE 6
          19:27:18,248 DEBUG DelegatingVariableResolver:106 - Attempting to resolve variable 'ajaxContext' in via original VariableResolver
          19:27:18,248 DEBUG BaseXMLFilter:188 - Process response to well-formed XML for AJAX XMLHttpRequest parser
          19:27:18,248 DEBUG TidyXMLFilter:81 - Parsers pool empty - create new JTidy parser
          19:27:18,248 DEBUG TidyParser:216 - Message for HTML parsing : img lacks "alt" attribute
          19:27:18,248 DEBUG TidyParser:216 - Message for HTML parsing : missing <!DOCTYPE> declaration
          19:27:18,248 DEBUG TidyParser:216 - Message for HTML parsing : inserting missing 'title' element
          19:27:18,248 DEBUG TidyParser:216 - Message for HTML parsing : meta isn't allowed in <body> elements
          19:27:18,248 DEBUG TidyParser:216 - Message for HTML parsing : meta isn't allowed in <body> elements
          19:27:18,258 DEBUG BaseXMLFilter:274 - Parsing html total time 10ms
          19:27:18,258 DEBUG BaseFilter:298 - Finished request processing total time 170ms for uri: /MyApp/faces/pgs/sect/SecOne.xhtml

          #############################################################################################

          Thanks!

          • 2. Re: RichFaces elements not working after Tomcat-Apache conn
            terron

            hello,

            not an easy one...

            Some more things I was discovering comparing both sessions,
            "Tomcat standalone" (no problems) and "Tomcat+Apache"
            is that with the last one (where the features mentioned before are not working),
            there is a Javascript error in both Firefox and internetexplorer:

            FF:


            RichFaces is not defined:
            http://myServer.com/myApp/faces/a4j.res/org/ichfaces/renderkit/html/scripts/suggestionbox.js


            if(!Exadel)var Exadel={};var Suggestion={};Suggestion.Base=function(){};Suggestion.Base.prototype={baseInitialize:function(element,update,options)
            {this.isOpera=(RichFaces.navigatorType()=="OPERA"?true:false);
            this.element=$(element);this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.prevIndex=-1;
            this.entryCount=0;this.keyEvent=false;this.oldValue=this.element.value;var needIframe=(RichFaces.navigatorType()=="MSIE");
            if(needIframe){options.iframeId=update+"_iframe";}


            IE:


            Error: 'RichFaces' is undefined
            Code: 0
            URL: http://myServer.com/myApp/faces/path/pageA.xhtml


            This has to tell you something...

            Why is when connecting Tomcat with Apache
            RichFaces not defined (but only for the richfaces elements which have to come back with a "kindof popup"
            like suggestionbox and modalpanel)?

            Please give me any feedback!
            Thanks

            • 3. Re: RichFaces elements not working after Tomcat-Apache conn

              Hi everybody

              I have the same problem, and up to now no solution… you found a solution

              • 4. Re: RichFaces elements not working after Tomcat-Apache conn
                larry3k

                ok we found the problem but, nobody here dont understand it: the server time was 7 (!!!) mintues later than the localtime on the client computer. after setting the servertime with date -s the error in IE went away !!! please, forum , tell me whats going on here !!

                thanks a lot


                • 5. Re: RichFaces elements not working after Tomcat-Apache conn
                  nbelaevski

                  Hi,

                  Looks like something happened with that particular scripts. Let's explore the issue:

                  1. Please check if there are some errors loading scripts using Firebug "Net" tab
                  2. If there are no errors please compare content of files with and without Apache (or copy both from buffer using Firebug and post them somewhere)