10 Replies Latest reply on Sep 1, 2011 4:39 PM by pferraro

    ROOT ignored in excludedContexts

    larstobi

      System info:

       

      JBoss: jbossas-5.1.1-16.ep5.el5   (From RHEL5 RHN-channel "jbappplatform-5-x86_64-server-5-rpm")

      mod_cluster: mod_cluster-1.1.3.Final-bin.zip

      mod_cluster-native: mod_cluster-native-1.1.3-1.x86_64.rpm (compiled for httpd-2.2.17-11.1.ep5.el5)

       

      {code}JAVA_OPTS+=" -Djboss.mod_cluster.excludedContexts=ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console"{code}

       

      Even though I add ROOT to excludedContexts as specified in the docs, the / context path still registers with Apache.

       

      {code}Node: [1],Name: 3e4aaeca-e3a0-3f3e-a017-8bbf1e995154,Balancer: mycluster,LBGroup: ,Host: xxx.xxx.xxx.203,Port: 8009,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 1

      Vhost: [1:1:1], Alias: localhost

      Context: [1:1:1], Context: /, Status: ENABLED

      Context: [1:1:3], Context: /solr, Status: ENABLED{code}

       

      /etc/httpd/conf.d/cluster.conf:

       

      {code}Listen 7777

      <VirtualHost *:7777>

        <Directory />

           Order deny,allow

           Allow from all

        </Directory>

       

        CreateBalancers 2

        KeepAliveTimeout 60

        MaxKeepAliveRequests 0

        ServerAdvertise Off

        AllowDisplay On

       

        <Location /mod_cluster_manager>

          SetHandler mod_cluster-manager

          Order deny,allow

          Allow from all

        </Location>

      </VirtualHost>{code}

       

       

      What else can I do to make JBoss not register the / context?

        • 1. Re: ROOT ignored in excludedContexts
          jfclere

          Check the mod-cluster.sar/META-INF/mod-cluster-jboss-beans.xml

          there should something like:

          <property name="excludedContexts">${jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>

           

          So it is -Djboss.modcluster.excludedContexts .... Note you try to use the default doing nothing should have work.

          • 2. Re: ROOT ignored in excludedContexts
            larstobi

            This line is unchanged by me and straight from the 1.1.3 tarball:

            <property name="excludedContexts">${jboss.mod_cluster.excludedContexts,jboss.modcluster.excludedContexts:ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console}</property>

             

            So, bot jboss.modcluster and jboss.mod_cluster should work, however I have also tried withhout the underscore with no luck.

             

            However, my profile folder was a copy of the web profile, and I just tried renaming ROOT.war to jboss-ROOT.war, and excluded jboss-ROOT instead of just ROOT. Now it correctly excludes the context.

             

            Is this a bug, or is it the correct behaviour? If it is correct behaviour, can I achieve the same without renaming ROOT.war, or is this rename required?

            • 3. Re: ROOT ignored in excludedContexts
              jfclere

              That looks like a bug :-(

              • 4. Re: ROOT ignored in excludedContexts
                larstobi

                Okay, then I'll file a bug report. We have a good workaround with the renaming of ROOT.war in the mean time.

                • 5. Re: ROOT ignored in excludedContexts
                  jfclere

                  MODCLUSTER-253

                  • 6. Re: ROOT ignored in excludedContexts
                    pferraro

                    I don't actually think this is a bug.  Does your server.xml specify a specific host name, e.g. <Host name="myhost">?

                    The values contain in excludedContexts are expected to be host-delimited.  If no host is specified, it is assumed to be "localhost".

                    To exclude the root context of a specific host, you would use something like this:

                    <property name="excludedContexts">myhost:ROOT,myhost:mycontext</property>

                    • 7. Re: ROOT ignored in excludedContexts
                      pferraro

                      To elaborate, when parsing the excludedContexts, mod_cluster translates "ROOT" to the "" context, not "/".  Jean-Frederic, is there a chance that the version of jbossweb in use here might be expecting "/" instead of ""?

                      • 8. Re: ROOT ignored in excludedContexts
                        jfclere

                        We have in main/java/org/jboss/modcluster/mcmp/impl/ResetRequestSourceImpl.java:

                                 if (path.equals(""))

                                          path = "/";

                        • 9. Re: ROOT ignored in excludedContexts
                          larstobi

                          I have localhost in my server.xml, and no aliases.

                          • 10. Re: ROOT ignored in excludedContexts
                            pferraro

                            FYI, I tracked down the issue to a regression caused by MODCLUSTER-220.  I've committed a fix, which will be included in 1.1.4.Final.