Apache Proxy Breaks RichFaces

Home/Java/JBoss/Seam/Apache Proxy Breaks RichFaces

I’ve run into this twice now, so I wanted to document it here to help other folks, and to see if anyone knows the root cause of the issue.

When using RichFaces with Seam, things work just fine on my local development JBoss instance. But when I deploy the same EAR file up to my production JBoss instance, which is sitting behind an Apache proxy, everything works EXCEPT the rich/ajax stuff.

The issue was that the JavaScript located here: ContextRoot/a4j_3_1_4.GAorg.ajax4jsf.javascript.AjaxScript

would not load.

My Apache proxy was configured like this:

	ProxyPass /10MinuteMail balancer://mycluster/10MinuteMail/
	ProxyPass /10MinuteMail/* balancer://mycluster/10MinuteMail/
	ProxyPassReverse /10MinuteMail http://127.0.0.1:8080/10MinuteMail

With mycluster defined like this:

        
                AddDefaultCharset off
                Order deny,allow
                Allow from all

		BalancerMember http://127.0.0.1:8080
                #Allow from .example.com
        

Again, this configuration worked fine for everything EXCEPT that RichFaces JavaScript.

Since I am only using one node for 10MinuteMail, there is no real need for a load balancer configuration, so I replaced the configuration with this:

	ProxyPass /10MinuteMail http://127.0.0.1:8080/10MinuteMail
	ProxyPass /10MinuteMail/ http://127.0.0.1:8080/10MinuteMail/
        ProxyPassReverse /10MinuteMail/ http://127.0.0.1:8080/10MinuteMail/

Which works, and fixed the RichFaces reference.

So there’s your solution. However I have no idea what the actual root cause is.

By | 2008-03-23T23:24:19+00:00 March 23rd, 2008|Seam|4 Comments

About the Author:

4 Comments

  1. Jeremy March 24, 2008 at 1:40 pm - Reply

    This post is copied on another website without a link back to your original post or any credit to you. I found your original here by Googling the title. Check out
    http://www.virtisys.com/2008/03/23/apache-proxy-breaks-richfaces/

    I have contacted the hosting company for virtisys regarding copyright infringement of my own work (they ripped off one of my posts as well). You might consider doing the same. Or if you don’t care, then please pardon the interruption.

    Cheers,
    Jeremy

  2. Devon March 24, 2008 at 1:59 pm - Reply

    Jeremy,

    thank you for the heads up! I have also contact the hosting company, which happens to be my hosting company as well. Hopefully we’ll get some movement on this.

    Thanks again!

    Devon

  3. Devon March 26, 2008 at 2:37 pm - Reply

    Looks like they’ve taken the site down! That’s great!

  4. Thiago Moreira March 28, 2012 at 2:07 pm - Reply

    Did you ever find the real problem if the balancer + richfaces? I got the same issue and fixed with your workaround but I need a solution for a balancer.

Leave A Comment