Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2771

ServiceBindingManager should allow more control over Tomcat5 ports

XMLWordPrintable

      I AM able to override tomcat's connector port settings with the ServiceBindingManager ...
      BUT not to my complete satisfaction.
      The only possibility offerered by XSLTFileDelegate is to pass a host or port parameter - unfortunately, the xslt-param element is not processed, as in the sibling XSLTConfigDelegate. As a consequence, $portAJP can only be computed from $port, but not passed directly as a parameter.
      This bug also affects the documentation (The JBoss 4 Application Server Guide
      JBoss AS 4.0.3, Release 4), since on page 334 it states that

      "The XSLTConfigDelegate is used to transform services whose port/interface configuration is specified using a
      nested XML fragment. The following example maps the Tomcat servlet container listening port to 8180 and maps
      the AJP listening port to 8109:"

      This is wrong, because the example actually makes use of XSLTFileDelegate, which is really misleading.

      It would be EXTREMELY easy to fix this bug by simply injecting the code from XSLTConfigDelegate into XSLTFileDelegate as follows (plus necessary import statements):

      //[...]
      if (host != null)

      { transformer.setParameter("host", host); }

      // +++++++++++++ MY MANUAL PATCH BEGIN
      // Check for any arbitrary attributes
      NodeList attributes = delegateConfig.getElementsByTagName("xslt-param");
      // xslt-param are transform parameters
      for(int a = 0; a < attributes.getLength(); a ++)

      { Element attr = (Element) attributes.item(a); String name = attr.getAttribute("name"); if( name.length() == 0 ) throw new IllegalArgumentException("attribute element #" +a+" has no name attribute"); String attrExp = MetaData.getElementContent(attr); String attrValue = StringPropertyReplacer.replaceProperties(attrExp); transformer.setParameter(name, attrValue); log.debug("set "+name+" parameter to:"+attrValue); }

      // +++++++++++++ MY MANUAL PATCH END

      transformer.transform(xmlSource, xmlResult);
      //[...]

              starksm64 Scott Stark (Inactive)
              twenckebach_jira Thomas Wenckebach (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: