1 Reply Latest reply on Oct 18, 2004 5:16 PM by Chuck James

    ServiceBindingManager with Tomcat problems

    Joe Hudson Newbie

      I have not been able to sucessfully override the Tomcat ports using the ServiceBindingManager. I have registered the ServiceBindingManager in my jboss-service.xml file. I know that this is recognized because all of the other ports are overridden (rmi, iiop...) exept Tomcat.

      Can anybody give me some idea as to what I am doing wrong? Thanks very much.

      Joe


      jboss0
      ${jboss.server.base.dir}/bindings.xml

      org.jboss.services.binding.XMLServicesStoreFactory



      My bindings.xml file is below:

      <service-bindings>

      <!-- ********************************************************** -->
      <!-- * jboss0 * -->
      <!-- ********************************************************** -->


      <!-- ********************* jboss-service.xml ****************** -->

      <service-config name="jboss:service=Naming"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port" hostName="BindAddress">
      1198
      </delegate-config>

      </service-config>


      <service-config name="jboss:service=WebService"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>


      <service-config name="jboss:service=invoker,type=jrmp"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <service-config name="jboss:service=invoker,type=pooled"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="ServerBindPort"/>
      <!-- don't care for now -->

      </service-config>

      <!-- ********************* cluster-service.xml **************** -->

      <service-config name="jboss:service=HAJNDI"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>

      <service-config name="jboss:service=invoker,type=jrmpha"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <!-- ********************* iiop-service.xml ****************** -->

      <service-config name="jboss:service=CorbaORB"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>


      <!-- ********************* jmx-rmi-adaptor.sar **************** -->

      <service-config name="jboss.jmx:type=Connector,name=RMI"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <!-- ********************* snmp-adaptor.sar ****************** -->

      <service-config name="jboss.jmx:name=SnmpAgent,service=trapd,type=logger"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>


      <!-- ********************* jbossmq-service.xml **************** -->

      <!-- JMS related services -->
      <service-config name="jboss.mq:service=InvocationLayer,type=UIL2"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="ServerBindPort"/>

      </service-config>


      <!-- ********************* jbossweb-tomcat41.sar ***************** -->

      <service-config name="jboss.web:service=WebServer"
      delegateClass="org.jboss.services.binding.XSLTConfigDelegate"
      >
      <delegate-config>
      <xslt-config configName="Config"><![CDATA[
      <xsl:stylesheet
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

      <xsl:output method="xml" />
      <xsl:param name="port"/>

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

      <xsl:template match="/">
      <xsl:apply-templates/>
      </xsl:template>

      <xsl:template match = "Connector">

      <xsl:for-each select="@*">
      <xsl:choose>
      <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/>

      </xsl:template>

      <xsl:template match="*|@*">
      <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
      </xsl:template>
      </xsl:stylesheet>
      ]]>
      </xslt-config>
      </delegate-config>

      </service-config>




      <!-- ********************************************************** -->
      <!-- * jboss1 * -->
      <!-- ********************************************************** -->


      <!-- ********************* jboss-service.xml ****************** -->

      <service-config name="jboss:service=Naming"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port" hostName="BindAddress">
      1298
      </delegate-config>

      </service-config>


      <service-config name="jboss:service=WebService"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>


      <service-config name="jboss:service=invoker,type=jrmp"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <service-config name="jboss:service=invoker,type=pooled"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="ServerBindPort"/>
      <!-- don't care for now -->

      </service-config>

      <!-- ********************* cluster-service.xml **************** -->

      <service-config name="jboss:service=HAJNDI"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>

      <service-config name="jboss:service=invoker,type=jrmpha"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <!-- ********************* iiop-service.xml ****************** -->

      <service-config name="jboss:service=CorbaORB"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>


      <!-- ********************* jmx-rmi-adaptor.sar **************** -->

      <service-config name="jboss.jmx:type=Connector,name=RMI"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="RMIObjectPort"/>

      </service-config>


      <!-- ********************* snmp-adaptor.sar ****************** -->

      <service-config name="jboss.jmx:name=SnmpAgent,service=trapd,type=logger"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port"/>

      </service-config>

      <!-- ********************* jbossmq-service.xml **************** -->

      <!-- JMS related services -->
      <service-config name="jboss.mq:service=InvocationLayer,type=UIL2"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="ServerBindPort"/>

      </service-config>


      <!-- ********************* hsqldb-ds.xml ********************** -->

      <!-- Hypersonic related services

      Only if using TCP setup (local file setup by default)

      <service-config name="jboss.jca:service=ManagedConnectionFactory,name=DefaultDS"
      delegateClass="org.jboss.services.binding.XSLTConfigDelegate"
      >
      <delegate-config>
      <xslt-config configName="ManagedConnectionFactoryProperties"><![CDATA[
      <xsl:stylesheet
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

      <xsl:output method="xml" />
      <xsl:param name="host"/>
      <xsl:param name="port"/>

      <xsl:template match="/">
      <xsl:apply-templates/>
      </xsl:template>

      <xsl:template match="config-property[@name='ConnectionURL']">
      <config-property type="java.lang.String" name="ConnectionURL">jdbc:hsqldb:hsql://<xsl:value-of select='$host'/>:<xsl:value-of select='$port'/></config-property>
      </xsl:template>

      <xsl:template match="*|@*">
      <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
      </xsl:template>
      </xsl:stylesheet>
      ]]>
      </xslt-config>
      </delegate-config>

      </service-config>

      <service-config name="jboss:service=Hypersonic"
      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"
      >
      <delegate-config portName="Port" />

      </service-config>

      -->

      <!-- 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:output method="xml" />
      <xsl:param name="port"/>

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

      <xsl:template match="/">
      <xsl:apply-templates/>
      </xsl:template>

      <xsl:template match = "Connector">

      <xsl:for-each select="@*">
      <xsl:choose>
      <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/>

      </xsl:template>

      <xsl:template match="*|@*">
      <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
      </xsl:template>
      </xsl:stylesheet>
      ]]>
      </xslt-config>
      </delegate-config>

      </service-config>

      <!-- ********************* jbossweb-tomcat.sar ***************** -->

      <service-config name="jboss.web:service=WebServer"
      delegateClass="org.jboss.services.binding.XSLTConfigDelegate"
      >
      <delegate-config>
      <xslt-config configName="Config"><![CDATA[
      <xsl:stylesheet
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>

      <xsl:output method="xml" />
      <xsl:param name="port"/>

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

      <xsl:template match="/">
      <xsl:apply-templates/>
      </xsl:template>

      <xsl:template match = "Connector">

      <xsl:for-each select="@*">
      <xsl:choose>
      <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/>

      </xsl:template>

      <xsl:template match="*|@*">
      <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
      </xsl:template>
      </xsl:stylesheet>
      ]]>
      </xslt-config>
      </delegate-config>

      </service-config>



      </service-bindings>

      The JBoss log is below:

      08:44:01,062 INFO [Server] Starting JBoss (MX MicroKernel)...
      08:44:01,062 INFO [Server] Release ID: JBoss [WonderLand] 3.2.4RC2 (build: CVSTag=Branch_3_2 date=200405170233)
      08:44:01,062 INFO [Server] Home Dir: C:\java\jboss-3.2.4RC2
      08:44:01,062 INFO [Server] Home URL: file:/C:/java/jboss-3.2.4RC2/
      08:44:01,062 INFO [Server] Library URL: file:/C:/java/jboss-3.2.4RC2/lib/
      08:44:01,062 INFO [Server] Patch URL: null
      08:44:01,062 INFO [Server] Server Name: jboss0
      08:44:01,062 INFO [Server] Server Home Dir: C:\java\jboss-3.2.4RC2\server\jboss0
      08:44:01,062 INFO [Server] Server Home URL: file:/C:/java/jboss-3.2.4RC2/server/jboss0/
      08:44:01,078 INFO [Server] Server Data Dir: C:\java\jboss-3.2.4RC2\server\jboss0\data
      08:44:01,078 INFO [Server] Server Temp Dir: C:\java\jboss-3.2.4RC2\server\jboss0\tmp
      08:44:01,078 INFO [Server] Server Config URL: file:/C:/java/jboss-3.2.4RC2/server/jboss0/conf/
      08:44:01,078 INFO [Server] Server Library URL: file:/C:/java/jboss-3.2.4RC2/server/jboss0/lib/
      08:44:01,078 INFO [Server] Root Deployment Filename: jboss-service.xml
      08:44:01,078 INFO [Server] Starting General Purpose Architecture (GPA)...
      08:44:01,359 INFO [ServerInfo] Java version: 1.4.2_03,Sun Microsystems Inc.
      08:44:01,359 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_03-b02,Sun Microsystems Inc.
      08:44:01,359 INFO [ServerInfo] OS-System: Windows 2000 5.0,x86
      08:44:01,578 INFO [Server] Core system initialized
      08:44:03,875 INFO [ServiceBindingManager] Initializing store
      08:44:03,875 INFO [ServiceBindingManager] Using StoreURL: file:/C:/java/jboss-3.2.4RC2/server/bindings.xml
      08:44:04,578 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
      08:44:04,843 INFO [WebService] Using RMI server codebase: http://19BJT31:8183/
      08:44:04,906 INFO [NamingService] Started jnpPort=1199, rmiPort=1198, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFacto
      ry=org.jboss.net.sockets.DefaultSocketFactory@ad093076
      08:44:08,781 INFO [RARMetaData] Loading JBoss Resource Adapter for JDBC 2 XA drivers
      08:44:08,781 INFO [RARMetaData] Required license terms present. See deployment descriptor.
      08:44:11,093 INFO [Embedded] Catalina naming disabled
      08:44:11,625 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
      08:44:11,671 INFO [Catalina] Initialization processed in 500 ms
      08:44:11,671 INFO [StandardService] Starting service jboss.web
      08:44:11,671 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.24
      08:44:11,687 INFO [StandardHost] XML validation disabled
      08:44:11,703 INFO [StandardHost] Create Host deployer for direct deployment ( non-jmx )
      08:44:11,750 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      08:44:11,843 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
      08:44:11,843 INFO [JkMain] Jk running ID=0 time=0/15 config=null
      08:44:11,843 INFO [Catalina] Server startup in 172 ms
      08:44:11,984 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/java/jboss-3.2.4RC2/server/jboss0/deploy/http-invoker.sar/invoker.war/
      08:44:12,859 INFO [TomcatDeployer] deploy, ctxPath=, warUrl=file:/C:/java/jboss-3.2.4RC2/server/jboss0/deploy/jbossweb-tomcat50.sar/ROOT.war/
      08:44:13,046 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/java/jboss-3.2.4RC2/server/jboss0/deploy/jms/jbossmq-httpil.sar/j
      bossmq-httpil.war/
      08:44:13,187 INFO [DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI
      name 'java:/DefaultDS'
      08:44:13,531 INFO [A] Bound to JNDI name: queue/A
      08:44:13,546 INFO [B] Bound to JNDI name: queue/B
      08:44:13,546 INFO [C] Bound to JNDI name: queue/C
      08:44:13,546 INFO [D] Bound to JNDI name: queue/D
      08:44:13,546 INFO [ex] Bound to JNDI name: queue/ex
      08:44:13,578 INFO [testTopic] Bound to JNDI name: topic/testTopic
      08:44:13,578 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
      08:44:13,578 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
      08:44:13,578 INFO [testQueue] Bound to JNDI name: queue/testQueue
      08:44:13,656 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8193
      08:44:13,703 INFO [DLQ] Bound to JNDI name: queue/DLQ
      08:44:13,718 INFO [JmsXA] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/
      JmsXA'
      08:44:13,796 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/java/jboss-3.2.4RC2/server/jboss0/deploy/jmx-console.war/
      08:44:14,437 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/java/jboss-3.2.4RC2/server/jboss0/tmp/deploy/tmp8609web-console.war/

      08:44:15,015 INFO [Server] JBoss (MX MicroKernel) [3.2.4RC2 (build: CVSTag=Branch_3_2 date=200405170233)] Started in 13s:937ms