5 Replies Latest reply on Dec 21, 2004 8:11 PM by ryan.campbell

    server bindings

    Adrian Brock Master

      BEGIN ANOTHER RANT

      Yet again I want to test some clustering and use the server bindings to create
      two instances.
      But it is broken - address already in use errors, stale references (e.g. JBoss5
      contains tomcat55 but the references are to tomcat50).
      I'm not even sure how you use the binding manager to override
      Tomcat's server.xml anyway?

      There really needs to be regression test for this basic feature, once I've figured out
      how to fix the current configuration.

      END ANOTHER RANT

        • 1. Re: server bindings
          François Duchatelet Newbie

          Adrian,

          Using the XSLTFileDelegate works for me, at least in 3.2.5

          This is my extract of server-bindings for tomcat bindings

           <!-- jbossweb-tomcat50.sar -->
           <service-config name="jboss.web:service=WebServer" delegateClass="org.jboss.services.binding.XSLTFileDelegate">
           <delegate-config>
           <xslt-config configName="ConfigFile"><![CDATA[
           <xsl:stylesheet
           xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
          
           <xsl:import href="../server/tomcat-base-bindings.xsl" />
          
           <xsl:output method="xml" />
           <xsl:param name="port"/>
           <xsl:param name="jvmRoute"/>
          
           <xsl:variable name="portAJP" select="$port - 71"/>
           <xsl:variable name="portHttps" select="$port + 8443-8080"/>
          
           </xsl:stylesheet>
           ]]></xslt-config>
           <xslt-param name="jvmRoute">LB1</xslt-param>
           </delegate-config>
           <binding port="8080"/>
           </service-config>
           </server>
          
          


          And Here is the imported stylesheet:
          <xsl:stylesheet
           xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
          
           <xsl:output method="xml" />
          
           <xsl:template match="/">
           <xsl:apply-templates/>
           </xsl:template>
          
           <xsl:template match = "Engine[@name='MainEngine']">
           <Engine>
           <xsl:attribute name="jvmRoute"><xsl:value-of select="$jvmRoute" /></xsl:attribute>
           <xsl:apply-templates select="@*|node()"/>
           </Engine>
           </xsl:template>
          
           <xsl:template match = "Connector">
           <Connector>
           <xsl:for-each select="@*">
           <xsl:choose>
           <!-- fdu, turn dns lookups off -->
           <xsl:when test="name() = 'enableLookups'">
           <xsl:attribute name="enableLookups">false</xsl:attribute>
           </xsl:when>
           <!-- end of add -->
           <xsl:when test="(name() = 'port' and . = '8080')">
           <xsl:attribute name="port"><xsl:value-of select="$port" /></xsl:attribute>
           </xsl:when>
           <xsl:when test="(name() = 'port' and . = '8009')">
           <xsl:attribute name="port"><xsl:value-of select="$portAJP" /></xsl:attribute>
           </xsl:when>
           <xsl:when test="(name() = 'redirectPort')">
           <xsl:attribute name="redirectPort"><xsl:value-of select="$portHttps" /></xsl:attribute>
           </xsl:when>
           <xsl:when test="(name() = 'port' and . = '8443')">
           <xsl:attribute name="port"><xsl:value-of select="$portHttps" /></xsl:attribute>
           </xsl:when>
           <xsl:otherwise>
           <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>
           </xsl:otherwise>
           </xsl:choose>
           </xsl:for-each>
           <xsl:apply-templates/>
           </Connector>
           </xsl:template>
          
           <xsl:template match="*|@*">
           <xsl:copy>
           <xsl:apply-templates select="@*|node()"/>
           </xsl:copy>
           </xsl:template>
          
          </xsl:stylesheet>
          


          • 2. Re: server bindings
            Adrian Brock Master

            Thanks Gozilla,

            I didn't even know that this feature existed :-)

            I now need to investigate why it isn't working against Tomcat55
            I don't see an obvious change in the format.

            • 3. Re: server bindings
              François Duchatelet Newbie

              You're welcome, Adrian,

              BTW, I realize that the timestamps shown on the forums are 5 hours behind GMT, despite the mention 'All times are GMT'. ;)

              Cheers

              • 4. Re: server bindings
                Adrian Brock Master

                You should post that in the portal forum.
                It is probably the server is misconfigured wrt time zone (thinking its location is GMT when it is actually EST).

                • 5. Re: server bindings
                  ryan.campbell Expert

                  So we need to add a custom configuration of jboss to the testsuite which uses server bindings and tests that tomcat is listening on the designated ports.

                  http://jira.jboss.com/jira/browse/JBAS-75