4 Replies Latest reply on Nov 14, 2007 4:04 AM by annegret

    JBoss5.0.0.Beta1 multiple instances error

    jbs99

      Hi,
      I am facing some issues while doing the multi server instances on the same machine using JBoss5.0.0.Beta1 on XP machine. I am able to run the same with JBoss 4.0.5GA version. I searched the threads but not able to find the solution. If any body come across this error please help me in resolving this. Here are the steps i followed (The similar steps are working fine in JBoss4.0.5GA)

      1. Copied "all" server as "jboss1" and mapped the ServiceBindingManager to "ports-01" (as described in the document)
      2. Copied "all" server as "jboss2" and mapped the ServiceBindingManager to "ports-02"
      3. Started the jboss1 server.
      4. Started the jboss2 server. Here i got the below error.

      2007-01-02 16:02:16,546 ERROR [org.apache.coyote.http11.Http11Protocol] Error initializing endpoint
       java.net.BindException: Address already in use: JVM_Bind:8080
       at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:499)
       at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:175)
       at org.apache.catalina.connector.Connector.initialize(Connector.java:1024)
      

      5. Even after the above error i could able to see that the jboss2 is joined to jboss1 and jboss1 has become the dataOwner.
      2007-01-02 16:03:25,890 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Data owner address 192.168.57.35:4608
       2007-01-02 16:03:25,890 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Entering updateGroup. Current group: BuddyGroup: (dataOwner: 192.168.57.35:4608, groupName: 192.168.57.35_4608, buddies: []). Current View membership: [192.168.57.35:4608, 192.168.57.35:4625]
       2007-01-02 16:03:26,781 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
       2007-01-02 16:03:26,796 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying again, ignoring buddy pool hints.
       2007-01-02 16:03:26,812 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
       2007-01-02 16:03:26,859 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Assigning new buddies to buddy group [192.168.57.35_4608]. New buddies are [192.168.57.35:4625]

      6. I deploed the stateless session bean on both servers and able to get the out put.
      7. Now i stopped the jboss1. and immediatly the jboss2 console is displayed the message that the jboss2 has become the dataOwner
      2007-01-02 16:21:08,484 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Data owner address 192.168.57.35:4625
       2007-01-02 16:21:08,484 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Entering updateGroup. Current group: BuddyGroup: (dataOwner: 192.168.57.35:4625, groupName: 192.168.57.35_4625, buddies: [192.168.57.35:4608]). Current View membership: [192.168.57.35:4625]
       2007-01-02 16:21:08,546 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
       2007-01-02 16:21:08,546 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying again, ignoring buddy pool hints.
       2007-01-02 16:21:08,546 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates - trying with colocated buddies as well.
       2007-01-02 16:21:08,562 INFO [org.jboss.cache.buddyreplication.NextMemberBuddyLocator] Expected to look for 1 buddies but could only find 0 suitable candidates!
       2007-01-02 16:21:08,562 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Removing obsolete buddies from buddy group [192.168.57.35_4625]. Obsolete buddies are [192.168.57.35:4608]
       2007-01-02 16:21:08,593 INFO [org.jboss.cache.buddyreplication.BuddyManager] New buddy group: BuddyGroup: (dataOwner: 192.168.57.35:4625, groupName: 192.168.57.35_4625, buddies: [])
       2007-01-02 16:21:08,609 DEBUG [org.jboss.cache.buddyreplication.BuddyManager] Instance 192.168.57.35:4625 broadcasting membership in buddy pool default to recipients null

      8. Now the server should able to server the session bean requests but it is throwing the errors.

      Thanks
      -Jb

        • 1. Re: JBoss5.0.0.Beta1 multiple instances error

          Have you tried binding your server instances to IP addresses? If you're just trying a two node cluster on your machine, you can probably use either a wired/wireless combination or a wired/loopback combination.

          The IP address approach is generally simpler as you don't have to create/use a Service Binding configuration. You also won't encounter problems that might occur where a developer uses a port for something and isn't aware that the port must also be specified in the service binding file to avoid problems when running in a cluster.

          For example:
          run.bat -c server1 -b 192.168.1.101
          run.bat -c server2 -b 192.168.1.102

          • 2. Re: JBoss5.0.0.Beta1 multiple instances error
            jbs99

             

            "JerryGauth" wrote:
            Have you tried binding your server instances to IP addresses? If you're just trying a two node cluster on your machine, you can probably use either a wired/wireless combination or a wired/loopback combination.

            The IP address approach is generally simpler as you don't have to create/use a Service Binding configuration. You also won't encounter problems that might occur where a developer uses a port for something and isn't aware that the port must also be specified in the service binding file to avoid problems when running in a cluster.

            For example:
            run.bat -c server1 -b 192.168.1.101
            run.bat -c server2 -b 192.168.1.102

            Hi Jerry,
            Sorry i was on leave & Thanks for the reply. I am using the separate ports approach because it doesn't require network administrator for configuring multiple IPs. Can you share a link or more info on the "wired/wireless combination or a wired/loopback" approach. If anybody got succeeded in using ports approach, please share how did you configure them. I think the configuring approach might be different for Jboss5 as the same procedure working well with Jboss4.0.5.
            Thanks,
            -Jb

            • 3. Re: JBoss5.0.0.Beta1 multiple instances error

              I've used the separate ports approach (e.g., the binding file) successfully in the past but stopped because I would frequently encounter problems which required me to make changes to the port configurations.

              For developers at least, using the IP address binding approach is generally simpler. If you have multiple IP addresses on your machine, you can simply bind each server instance to one of your IP addresses when you start the server (e.g., run.bat -c server1 -b 192.168.1.101)

              If you have a laptop with a wired connection and a wireless connection, you can use their IP addresses as the two IP addresses for a two node network. If you only have a single connection, you should be able to follow your OS's instructions for enabling a loopback address to be used as the second IP address. Presumably you can configure a three node network on your machine using wired/wireless/loopback but I haven't tried this.

              If you need to use the binding file and it always fails on port 8080, try debugging the problem by modifying the use of port 8080 to another port in the file. If the problem manifests itself on the new port, then you know that the override entries in the file aren't correct. This could be because you didn't specify the correct node name or it could be because the file overrides themselves are wrong. If the problem still shows up on port 8080, then look for uses of port 8080 in your server's service files and try changing them there. This would indicate that either you haven't configured the override file process correctly or else the use of port 8080 has been changed and the format in the bindings file is no longer adequate to provide the override.

              I've had far fewer problems since I started using the IP address approach. The one caveat there is that you need to be aware of IP address changes if your machine has dynamic addresses. In my case at least, this is rarely a problem.

              Hope this helps.

              Jerry

              • 4. Re: JBoss5.0.0.Beta1 multiple instances error
                annegret

                Hi,

                I use JBoss 5.0.0 Beta 2 and run in the ths same problem : portconflict on 8080
                After changing some ports in the server configuration directly additional to the binding file I managed to run 2 instances of JBoss on the same machine.

                I had to change additional to the binding file the following ports in the server configuration directly:

                JBoss/server/deployers/jbossweb.deployer/server.xml
                ports 8080 and 8009

                 <Service name="jboss.web">
                
                 <!-- A HTTP/1.1 Connector on port 8080 -->
                 <Connector port="8080" address="${jboss.bind.address}"
                 maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
                 emptySessionPath="true"
                 enableLookups="false" redirectPort="8443" acceptCount="100"
                 connectionTimeout="20000" disableUploadTimeout="true"/>
                
                <snip>
                
                 <!-- A AJP 1.3 Connector on port 8009 -->
                 <Connector port="8009" address="${jboss.bind.address}"
                 emptySessionPath="true" enableLookups="false" redirectPort="8443"
                 protocol="AJP/1.3"/>
                


                JBoss/server/deploy/cluster-beans.xml
                ports 4447, 1100, 1101

                 <bean name="JRMPInvokerHA"
                 class="org.jboss.invocation.jrmp.server.JRMPInvokerHA">
                
                 <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=invoker,type=jrmpha", exposedInterface=org.jboss.invocation.jrmp.server.JRMPInvokerMBean.class, registerDirectly=true)</annotation>
                
                 <depends>HAPartition</depends>
                
                 <property name="serverAddress">${jboss.bind.address}</property>
                 <property name="RMIObjectPort">4447</property>
                
                 <!--
                 <property name="RMIObjectPort">0</property>
                 <property name="RMIClientSocketFactory">custom</property>
                 <property name="RMIServerSocketFactory">custom</property>
                 -->
                 </bean>
                
                <snip>
                
                 <bean name="HAJNDI" class="org.jboss.ha.jndi.HANamingService">
                
                 <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=HAJNDI", exposedInterface=org.jboss.ha.jndi.HANamingServiceMBean.class, registerDirectly=true)</annotation>
                
                 <depends>HAPartition</depends>
                
                 <property name="clusterPartition"><inject name="HAPartition"/></property>
                
                 <!-- Bind address of bootstrap and HA-JNDI RMI endpoints -->
                 <property name="bindAddress">${jboss.bind.address}</property>
                 <!-- Port on which the HA-JNDI stub is made available -->
                 <property name="port">1100</property>
                 <!-- RmiPort to be used by the HA-JNDI service once bound. 0 => auto. -->
                 <property name="rmiPort">1101</property>
                <snip>
                


                JBoss/server/deploy/messaging/remoting-service.xml
                port 4457

                 <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>
                <snip>
                
                


                How can I override these ports using the binding file ?

                Annegret