13 Replies Latest reply on May 17, 2007 6:45 AM by mskonda

    ServiceBindingManager config is not honoured

    mskonda Apprentice

      JBM-1.2.0.GA
      JBoss 4.0.5.GA

      I have updated my binginds file to reflect the service-config for ServiceBindingManager (shown below):

      <service-config name="jboss.messaging:service=Connector,transport=socket"
       delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
       <delegate-config>
       <attribute name="Configuration"><![CDATA[
       <config>
       <invoker transport="socket">
       <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
       <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
       <attribute name="serializationtype" isParam="true">jboss</attribute>
       <attribute name="dataType" isParam="true">jms</attribute>
       <attribute name="socket.check_connection" isParam="true">false</attribute>
       <attribute name="timeout">0</attribute>
       <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
       <attribute name="serverBindPort">53026</attribute>
       <attribute name="leasePeriod">20000</attribute>
       </invoker>
       <handlers>
       <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
       </handlers>
       </config>]]>
       </attribute>
       </delegate-config>
      
       <binding port="53026"/>
       </service-config>
      


      However, this config seems to be not honoured as the second instance complains about the in use port.

      I have to change the jboss-messaging.sar/remoting-service.xml in order to work.

      Is this a known bug? or am I missing something in config?

      Thanks
      Madhu

        • 1. Re: ServiceBindingManager config is not honoured
          Clebert Suconic Master

          What file is that?

          For changing remoting properties, you have to change jboss-messaging.sar/remoting-service.xml.

          <mbean code="org.jboss.remoting.transport.Connector"
           name="jboss.messaging:service=Connector,transport=bisocket"
           display-name="Bisocket transport Connector">
           <attribute name="Configuration">
           <config>
           <invoker transport="bisocket">
           <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
           <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
           <!-- Serialization type must be jms - do not change! -->
           <attribute name="serializationtype" isParam="true">jms</attribute>
           <attribute name="dataType" isParam="true">jms</attribute>
           <attribute name="socket.check_connection" isParam="true">false</attribute>
           <attribute name="timeout">0</attribute>
           <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
           <attribute name="serverBindPort">4457</attribute>
           <attribute name="leasePeriod">10000</attribute>
           <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
           <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
           <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
           <attribute name="callbackErrorsAllowed">1</attribute>
           <attribute name="numberOfRetries" isParam="true">1</attribute>
           <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
           <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
           </invoker>
           <handlers>
           <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
           </handlers>
           </config>
           </attribute>
           <depends>jboss.messaging:service=NetworkRegistry</depends>
           </mbean>
          



          Notice that the transport now is bisocket... it looks like you were referring to an old version?

          • 2. Re: ServiceBindingManager config is not honoured
            mskonda Apprentice

            Sorry clebert, I posted the wrong code (yes older version) by mistake by in actual I am usign this one Clebert (which is the new one):

            <!-- ********************* JBoss Messaging**************** -->
            
             <service-config name="jboss.messaging:service=Connector,transport=socket"
             delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
             <delegate-config>
             <attribute name="Configuration"><![CDATA[
             <config>
             <invoker transport="bisocket">
             <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
             <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
             <!-- Serialization type must be jms - do not change! -->
             <attribute name="serializationtype" isParam="true">jms</attribute>
             <attribute name="dataType" isParam="true">jms</attribute>
             <attribute name="socket.check_connection" isParam="true">false</attribute>
             <attribute name="timeout">0</attribute>
             <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
             <attribute name="serverBindPort">19032</attribute>
             <attribute name="leasePeriod">10000</attribute>
             <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
             <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
             <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
             <attribute name="callbackErrorsAllowed">1</attribute>
             <attribute name="numberOfRetries" isParam="true">1</attribute>
             <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
             <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
             </invoker>
             <handlers>
             <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
             </handlers>
             </config>]]>
             </attribute>
             </delegate-config>
            
             <binding port="19032"/>
             </service-config>


            This config is from my server-bindings.xml which will override all the ports quoted in individual files such as remoting-service.xml

            I don't have to go to remoting-service.xml to change the port of the connector but should reflect the one mentioned in my server bindings file, isn't it? Unfortunately it seems that the port is picked up from remoting-service.xml rather than my bindings file:

            17:43:41,947 ERROR [SocketServerInvoker] Error starting ServerSocket. Bind port: 7544, bind address: /0.0.0.0
            17:43:41,948 ERROR [Connector] Error starting connector.
            java.net.BindException: Address already in use
             at java.net.PlainSocketImpl.socketBind(Native Method)
             at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
             at java.net.ServerSocket.bind(ServerSocket.java:319)
             at java.net.ServerSocket.<init>(ServerSocket.java:185)
             at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
             at org.jboss.remoting.transport.socket.SocketServerInvoker.createServerSocket(SocketServerInvoker.java:260)
             at org.jboss.remoting.transport.socket.SocketServerInvoker.start(SocketServerInvoker.java:189)
             at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.start(BisocketServerInvoker.java:119)
             at org.jboss.remoting.transport.Connector.start(Connector.java:322)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             at org.jboss.system.ServiceController.start(ServiceController.java:435)
             at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy4.start(Unknown Source)
             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
            


            Thanks
            Madhu

            • 3. Re: ServiceBindingManager config is not honoured
              Clebert Suconic Master

              Ah.. you mean the ServiceBindings from JBossAS... Hummm...

              We don't make usage of that now... so.. you're right.. you have to define this by hand on the XML for now.

              • 4. Re: ServiceBindingManager config is not honoured
                mskonda Apprentice

                Thanks Clebert.

                Any idea when is gonna go for implementation? Would please raise a JIRA request on this issue?

                Thanks
                Madhu

                • 5. Re: ServiceBindingManager config is not honoured
                  Tim Fox Master

                  Actually we do make use of service binding manager.

                  You just need to make sure the remoting config section exactly matches the one in remoting-service.xml then make sure you start each server with the right ports config e.g. ports01, ports02 etc.

                  This works fine for me.

                  • 6. Re: ServiceBindingManager config is not honoured
                    mskonda Apprentice

                    Tim, here's my service-config def in bindings file:

                    < <config>
                    < <invoker transport="bisocket">
                    < <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                    < <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                    < <!-- Serialization type must be jms - do not change! -->
                    < <attribute name="serializationtype" isParam="true">jms</attribute>
                    < <attribute name="dataType" isParam="true">jms</attribute>
                    < <attribute name="socket.check_connection" isParam="true">false</attribute>
                    < <attribute name="timeout">0</attribute>
                    < <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
                    < <attribute name="serverBindPort">4457</attribute>
                    < <attribute name="leasePeriod">10000</attribute>
                    < <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
                    < <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
                    < <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
                    < <attribute name="callbackErrorsAllowed">1</attribute>
                    < <attribute name="numberOfRetries" isParam="true">1</attribute>
                    < <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
                    < <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
                    < </invoker>
                    < <handlers>
                    < <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
                    < </handlers>
                    < </config>
                    


                    and the def of remote-service.xml here:

                    <config>
                    > <invoker transport="bisocket">
                    > <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                    > <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                    > <!-- Serialization type must be jms - do not change! -->
                    > <attribute name="serializationtype" isParam="true">jms</attribute>
                    > <attribute name="dataType" isParam="true">jms</attribute>
                    > <attribute name="socket.check_connection" isParam="true">false</attribute>
                    > <attribute name="timeout">0</attribute>
                    > <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
                    > <attribute name="serverBindPort">19032</attribute>
                    > <attribute name="leasePeriod">10000</attribute>
                    > <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
                    > <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
                    > <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
                    > <attribute name="callbackErrorsAllowed">1</attribute>
                    > <attribute name="numberOfRetries" isParam="true">1</attribute>
                    > <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
                    > <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
                    > </invoker>
                    > <handlers>
                    > <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
                    > </handlers>
                    > </config>
                    


                    The only diff I can see is the serverBindPort which is what you expect to change in the main port bindings file rather than changing at instance level (That is, editing remote-service.xml)

                    This setup however throws the AddresAlreadyInUseException:

                    2:54:31,995 INFO [ServerPeer] ServerPeer[0] creating server peer with ID 0
                    12:54:32,401 ERROR [SocketServerInvoker] Error starting ServerSocket. Bind port: 4457, bind address: /0.0.0.0
                    12:54:32,405 ERROR [Connector] Error starting connector.
                    java.net.BindException: Address already in use
                    


                    Ofcouser this is because, someother server is already using 4457 (and hence using server-config to attah a new port)

                    Thanks
                    Madhu

                    • 7. Re: ServiceBindingManager config is not honoured
                      mskonda Apprentice

                      Tim/Team? Any feedback on this?

                      • 8. Re: ServiceBindingManager config is not honoured
                        Tim Fox Master

                        It seems at some time (not sure who/why) something changed (probably in remoting) so the servicebindingmanager config for the remoting connector needs to specified as a long string (see the JBAS 4.0.5 default config for more details) rather than xml.

                        E.g.

                         <service-config name="jboss.messaging:service=Connector,transport=socket"
                         delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
                         <delegate-config>
                         <attribute name="InvokerLocator">socket://${jboss.bind.address}:4457/?dataType=jms&serializationtype=jms&timeout=0&leasePeriod=20000&socket.check_connection=false&marshaller=org.jboss.jms.server.remoting.JMSWireFormat&unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                         </delegate-config>
                         <binding port="4457"/>
                         </service-config>
                        


                        So you're going to need convert the xml to the invoker locator string by hand and copy it in to the config.

                        I admit this is annoying - it was much easier when you could just copy and paste the xml.

                        I will investigate why/who changed this.

                        • 9. Re: ServiceBindingManager config is not honoured
                          mskonda Apprentice

                          Tim, what about other attribtes, such as:
                          callbackStore
                          clientSocketClass
                          serverSocketClass
                          NumberOfCallRetries
                          etc..

                          Do you suggest we should supply these attributes same way as that long string?

                          Thanks
                          Madhu

                          • 10. Re: ServiceBindingManager config is not honoured
                            mskonda Apprentice

                            I tried applying your fix Tim, but the conenctor is still startign on the port specified in remoting-service.xml (at 4457 port instead of my defined one in bindings file)

                            Also, the & after ever poperty=value in the above string must be read as & (else will get a SAX exception)

                            • 11. Re: ServiceBindingManager config is not honoured
                              Tim Fox Master

                              Madhu-

                              Once I jave found out how/why the change was made I will get back to you.

                              • 12. Re: ServiceBindingManager config is not honoured
                                Tim Fox Master

                                Madhu-

                                I can get this to work fine, by specifying something like the following in the sample-bindings.xml:

                                <service-config name="jboss.messaging:service=Connector,transport=bisocket"
                                 delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
                                 <delegate-config>
                                 <attribute name="Configuration"><![CDATA[
                                 <config>
                                 <invoker transport="bisocket">
                                 <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                                 <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
                                 <attribute name="serializationtype" isParam="true">jms</attribute>
                                 <attribute name="dataType" isParam="true">jms</attribute>
                                 <attribute name="socket.check_connection" isParam="true">false</attribute>
                                 <attribute name="timeout" isParam="true">0</attribute>
                                 <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
                                 <attribute name="serverBindPort">4457</attribute>
                                 <attribute name="leasePeriod">10000</attribute>
                                 <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
                                 <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
                                 <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
                                 <attribute name="callbackErrorsAllowed">1</attribute>
                                 <attribute name="numberOfRetries" isParam="true">1</attribute>
                                 <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
                                 <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
                                 </invoker>
                                 <handlers>
                                 <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
                                 </handlers>
                                 </config>
                                 ]]></attribute>
                                 </delegate-config>
                                 <binding port="4457"/>
                                 </service-config>
                                
                                 </server>
                                


                                Looking at your original example, it seems you are specifying the "socket" transport. 1.2.0 uses the bisocket transport.

                                You need to make sure the config specified in the service binding manager matches the config in remoting-service.xml that you are using.

                                • 13. Re: ServiceBindingManager config is not honoured
                                  mskonda Apprentice

                                  That's the killer! It works Tim.

                                  Thanks
                                  Madhu