6 Replies Latest reply on Jul 7, 2010 4:23 PM by vkopichenko

    JBoss 5.1 reconfigures tomcat's server.xml???

    ndario

      I noticed that JBoss ignored my https port setting and kept forwarding to 8443 even though I explicitely set redirectPort=443 in server.xml.

      It took hours to stumble upon short article that describes how JBoss5.1 actually overrides "server.xml" settings with "bindings-jboss-beans.xml".

      Why is that? What I need to do configure https redirect port? And WHERE?

      Could anybody please explain reason behind this? How is this supposed to work? Having two config files for the same thing is not the best option.

      Thanks.

        • 1. Re: JBoss 5.1 reconfigures tomcat's server.xml???
          jaikiran

          Although not exactly an answer to your question, there was similar discussion here http://www.jboss.org/index.html?module=bb&op=viewtopic&t=162025

          • 2. Re: JBoss 5.1 reconfigures tomcat's server.xml???
            vickyk

             

            "ndario" wrote:
            I noticed that JBoss ignored my https port setting and kept forwarding to 8443 even though I explicitely set redirectPort=443 in server.xml.
            .

            Strange!
            I had tried overriding the connector port in server.xml some time back and it worked, I would have expected the same true for the redirectPort.
            Did you managed to get more details for your query?

            • 3. Re: JBoss 5.1 reconfigures tomcat's server.xml???
              brian.stansberry

              The problem is the ServiceBindingManager is doing an XSL transform on server.xml, and the logic that does that can only use a single variable as the basis for calculating ports. So it uses the HTTP port (e.g. 8080) and calculates AJP and HTTPS as an increment/decrement to that. The config you want isn't matching that pattern, so you're stuck.

              That XSL transform is kludgy; probably better would be to use system properties in server.xml and have the ServiceBindingManager set the properties. I just opened a JIRA to do that:

              https://jira.jboss.org/jira/browse/JBAS-7466

              Do you need ServiceBindingManager; i.e. do you want to run multiple AS instances on the same IP address, or control configuration of the ports via embedded console? If not, edit deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml, and find this snippet:

               <property name="configFile">
               <value-factory bean="ServiceBindingManager" method="getResourceBinding">
               <parameter>jboss.web:service=WebServer</parameter>
               <parameter>${jboss.server.home.url}${/}deploy${/}jbossweb.sar${/}server.xml</parameter>
               </value-factory>
               </property>


              Change it to this:

               <property name="configFile">${jboss.server.home.url}${/}deploy${/}jbossweb.sar${/}server.xml</value-factory>
               </property>


              That will get rid of the XSLT; JBoss Web will just use the raw contents of server.xml.

              • 4. Re: JBoss 5.1 reconfigures tomcat's server.xml???
                brian.stansberry

                If you (or anyone reading this) do need ServiceBindingManager to handle the JBoss Web connector ports, another option is to edit the XSLT. This requires that there be a fixed relationship between the HTTP port and the HTTPS port, e.g.:

                If HTTP is on 8080 and HTTPS is on 443
                Then if HTTP is on 8180, HTTPS is on 543

                If so you can edit conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml. Look toward the bottom for:

                 <xsl:variable name="portAJP" select="$port - 71"/>
                 <xsl:variable name="portHttps" select="$port + 363"/>
                


                and change to reflect the relationship you want, e.g. for 8080/443:

                 <xsl:variable name="portAJP" select="$port - 71"/>
                 <xsl:variable name="portHttps" select="$port - 7637"/>
                


                JBAS-7466 is a better solution, but the above and my previous post are workarounds.

                • 5. Re: JBoss 5.1 reconfigures tomcat's server.xml???
                  ndario

                  Brian,

                  thanks a lot for a detailed answer.

                  • 6. Re: JBoss 5.1 reconfigures tomcat's server.xml???
                    vkopichenko

                    Look at https://jira.jboss.org/browse/JBAS-2771

                    It gives a suitable solution until JBoss 6.

                     

                    Just replace

                    <xsl:variable name="portAJP" select="$port - 71"/>
                    <xsl:variable name="portHttps" select="$port + 363"/>

                    with

                    <xsl:param name="portAJP"/>
                    <xsl:param name="portHttps"/>

                    and add

                    <xslt-param name="portAJP">8009</xslt-param>
                    <xslt-param name="portHttps">8443</xslt-param>

                    before </delegate-config>