5 Replies Latest reply on Jul 22, 2009 6:19 PM by Brian Stansberry

    JBoss 5.1.0.GA. Why difference between -b and -Djboss.bind.a

    Vladyslav Kosulin Newbie

      It looks like it is not possible to replace -b 0.0.0.0 with set of system properties passed to jvm with as -D parameters.
      I prepare migration to JBoss 5.1.0.GA from JBoss 4.2.3, and while playing with run.conf.bat, found that -b command line option can not be mimicked with java system properties.
      Here is what happens.
      I do not set bind_addr in XML files.
      When I use -b 0.0.0.0, I see what is actually expected (services listen on all interfaces, JGroups node name is properly assigned:
      ...
      GMS: address is 147.249.124.180:3847 (cluster=Partition112)
      ...
      18:00:17,046 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
      ...

      But when I use -Djboss.bind.address=0.0.0.0, JGroups node name is not assigned properly. I am getting:
      ...
      GMS: address is 0.0.0.0:4011 (cluster=Partition112)
      ...
      10:01:29,377 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
      ...

      The same happens when I use -Djboss.bind.address=0.0.0.0 -Dbind.address=0.0.0.0

      Isn't JGroups supposed to use only -Djgroups.bind_address? Because it looks like the only way to make clustering work without XML is to use -b option.
      Is this behavior expected?

        • 1. Re: JBoss 5.1.0.GA. Why difference between -b and -Djboss.bi
          Brian Stansberry Master

          Use -Djboss.bind.address=0.0.0.0 -Djgroups.bind_addr=0.0.0.0

          • 2. Re: JBoss 5.1.0.GA. Why difference between -b and -Djboss.bi
            Vladyslav Kosulin Newbie

            This is not working:
            ===============================================================================

            JBoss Bootstrap Environment

            JBOSS_HOME: D:\java\jboss-5.1.0.GA

            JAVA: C:\Program Files\Java\jre6\bin\java

            JAVA_OPTS: -Dprogram.name=run.bat -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dcom.wsc.taxgard.envfile=custom.properties -Dsyslog.address=syslog -Dsyslog.port=514 -Dlog4jdbc.drivers=com.sybase.jdbc3.jdbc.SybDataSource -Dlog4jdbc.sqltiming.warn.threshold=60000 -Dlog4jdbc.sqltiming.error.threshold=600000 -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Dorg.jboss.resolver.warning=true -Djboss.partition.udpGroup=230.1.1.012 -Djboss.partition.name=Partition1012 -Djboss.messaging.ServerPeerID=1 -Djboss.bind.address=0.0.0.0 -Djgroups.bind_addr=0.0.0.0 -Djboss.server.name=taxgard -Dcpportal.jvmRoute=wsc-voo-180 -server

            CLASSPATH: ;D:\java\jboss-5.1.0.GA\server\taxgard\conf\props\;;D:\java\jboss-5.1.0.GA\bin\run.jar

            ===============================================================================
            ...
            GMS: address is 0.0.0.0:4793 (cluster=Partition1012)
            ...
            GMS: address is 0.0.0.0:4793 (cluster=Partition1012-HAPartitionCache)
            ---------------------------------------------------------
            09:08:45,733 INFO [Partition1012] Number of cluster members: 1
            09:08:45,733 INFO [Partition1012] Other members: 0
            09:08:46,327 INFO [RPCManagerImpl] Received new cluster view: [0.0.0.0:4793|0] [0.0.0.0:4793]
            09:08:46,342 INFO [RPCManagerImpl] Cache local address is 0.0.0.0:4793
            ...
            09:08:46,327 INFO [RPCManagerImpl] Received new cluster view: [0.0.0.0:4793|0] [0.0.0.0:4793]
            ...
            09:08:51,687 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-0.0.0.0-8009
            09:08:52,578 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8443
            ...

            Any other ideas?
            Thanks.

            • 3. Re: JBoss 5.1.0.GA. Why difference between -b and -Djboss.bi
              Brian Stansberry Master

              No ideas. It works for me:

              C:\dev\jboss\Branch_5_x\build\output\jboss-5.1.0.CR1\bin>run -c all -Djboss.bind
              .address=0.0.0.0 -Djgroups.bind_addr=0.0.0.0
              ===============================================================================
              
               JBoss Bootstrap Environment
              
               JBOSS_HOME: C:\dev\jboss\Branch_5_x\build\output\jboss-5.1.0.CR1
              
               JAVA: c:\win32\dev\j6sdk\bin\java
              
               JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=25
              6m -Dorg.jboss.resolver.warning=true -Dxb.builder.useUnorderedSequence=true -Dsu
              n.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
              
               CLASSPATH: C:\dev\jboss\Branch_5_x\build\output\jboss-5.1.0.CR1\bin\run.jar
              
              ===============================================================================
              
              16:32:44,625 INFO [ServerImpl] Starting JBoss (Microcontainer)...
              16:32:44,625 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.CR1 (build:
               SVNTag=JBoss_5_1_0_CR1 date=200904222102)
              16:32:44,625 INFO [ServerImpl] Bootstrap URL: null
              16:32:44,625 INFO [ServerImpl] Home Dir: C:\dev\jboss\Branch_5_x\build\output\j
              boss-5.1.0.CR1
              16:32:44,625 INFO [ServerImpl] Home URL: file:/C:/dev/jboss/Branch_5_x/build/ou
              tput/jboss-5.1.0.CR1/
              16:32:44,625 INFO [ServerImpl] Library URL: file:/C:/dev/jboss/Branch_5_x/build
              /output/jboss-5.1.0.CR1/lib/
              16:32:44,625 INFO [ServerImpl] Patch URL: null
              16:32:44,625 INFO [ServerImpl] Common Base URL: file:/C:/dev/jboss/Branch_5_x/b
              uild/output/jboss-5.1.0.CR1/common/
              16:32:44,625 INFO [ServerImpl] Common Library URL: file:/C:/dev/jboss/Branch_5_
              x/build/output/jboss-5.1.0.CR1/common/lib/
              16:32:44,625 INFO [ServerImpl] Server Name: all
              16:32:44,625 INFO [ServerImpl] Server Base Dir: C:\dev\jboss\Branch_5_x\build\o
              utput\jboss-5.1.0.CR1\server
              16:32:44,625 INFO [ServerImpl] Server Base URL: file:/C:/dev/jboss/Branch_5_x/b
              uild/output/jboss-5.1.0.CR1/server/
              16:32:44,625 INFO [ServerImpl] Server Config URL: file:/C:/dev/jboss/Branch_5_x
              /build/output/jboss-5.1.0.CR1/server/all/conf/
              16:32:44,625 INFO [ServerImpl] Server Home Dir: C:\dev\jboss\Branch_5_x\build\o
              utput\jboss-5.1.0.CR1\server\all
              16:32:44,625 INFO [ServerImpl] Server Home URL: file:/C:/dev/jboss/Branch_5_x/b
              uild/output/jboss-5.1.0.CR1/server/all/
              16:32:44,625 INFO [ServerImpl] Server Data Dir: C:\dev\jboss\Branch_5_x\build\o
              utput\jboss-5.1.0.CR1\server\all\data
              16:32:44,625 INFO [ServerImpl] Server Library URL: file:/C:/dev/jboss/Branch_5_
              x/build/output/jboss-5.1.0.CR1/server/all/lib/
              16:32:44,625 INFO [ServerImpl] Server Log Dir: C:\dev\jboss\Branch_5_x\build\ou
              tput\jboss-5.1.0.CR1\server\all\log
              16:32:44,625 INFO [ServerImpl] Server Native Dir: C:\dev\jboss\Branch_5_x\build
              \output\jboss-5.1.0.CR1\server\all\tmp\native
              16:32:44,625 INFO [ServerImpl] Server Temp Dir: C:\dev\jboss\Branch_5_x\build\o
              utput\jboss-5.1.0.CR1\server\all\tmp
              16:32:44,625 INFO [ServerImpl] Server Temp Deploy Dir: C:\dev\jboss\Branch_5_x\
              build\output\jboss-5.1.0.CR1\server\all\tmp\deploy
              16:32:47,625 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/d
              ev/jboss/Branch_5_x/build/output/jboss-5.1.0.CR1/server/all/conf/bootstrap.xml
              16:32:49,750 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.pl
              ugins.cache.CombinedVFSCache]
              16:32:49,765 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache
              : null]]
              16:32:50,640 INFO [CopyMechanism] VFS temp dir: C:\dev\jboss\Branch_5_x\build\o
              utput\jboss-5.1.0.CR1\server\all\tmp
              16:32:50,671 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
              
              16:32:54,406 INFO [ServerInfo] Java version: 1.6.0_14,Sun Microsystems Inc.
              16:32:54,406 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (b
              uild 1.6.0_14-b08)
              16:32:54,406 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 14.0-b16,Sun
               Microsystems Inc.
              16:32:54,406 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
              16:32:54,406 INFO [ServerInfo] VM arguments: -Dprogram.name=run.bat -Xms128m -X
              mx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dxb.builder.useUn
              orderedSequence=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.serve
              r.gcInterval=3600000 -Djava.endorsed.dirs=C:\dev\jboss\Branch_5_x\build\output\j
              boss-5.1.0.CR1\lib\endorsed
              16:32:54,437 INFO [JMXKernel] Legacy JMX core initialized
              16:33:03,218 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey@1d16ecf
              [domain=default, server=default, name=all]
              16:33:10,093 INFO [WebService] Using RMI server codebase: http://JBOSS-33102AB2
              1:8083/
              16:33:28,953 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
              16:33:28,953 INFO [NativeServerConfig] 3.1.1.GA
              16:33:30,578 INFO [AttributeCallbackItem] Owner callback not implemented.
              16:33:33,812 INFO [LogNotificationListener] Adding notification listener for lo
              gging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss
              .mx.server.MBeanServerImpl@15c929a[ defaultDomain='jboss' ]
              16:34:07,546 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
              DeploymentContext@1070095{vfsfile:/C:/dev/jboss/Branch_5_x/build/output/jboss-5.
              1.0.CR1/server/all/deploy/profileservice-secured.jar/}
              16:34:07,562 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
              DeploymentContext@1070095{vfsfile:/C:/dev/jboss/Branch_5_x/build/output/jboss-5.
              1.0.CR1/server/all/deploy/profileservice-secured.jar/}
              16:34:07,562 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
              DeploymentContext@1070095{vfsfile:/C:/dev/jboss/Branch_5_x/build/output/jboss-5.
              1.0.CR1/server/all/deploy/profileservice-secured.jar/}
              16:34:07,562 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFS
              DeploymentContext@1070095{vfsfile:/C:/dev/jboss/Branch_5_x/build/output/jboss-5.
              1.0.CR1/server/all/deploy/profileservice-secured.jar/}
              16:34:11,203 INFO [CorbaNamingService] CORBA Naming Started
              16:34:22,250 INFO [JMXConnectorServerService] JMX Connector server: service:jmx
              :rmi://0.0.0.0/jndi/rmi://0.0.0.0:1090/jmxconnector
              16:34:23,093 INFO [MailService] Mail Service bound to java:/Mail
              16:34:24,859 INFO [SnmpAgentService] SNMP agent going active
              16:34:31,515 INFO [DefaultPartition] Initializing partition DefaultPartition
              16:34:31,828 INFO [STDOUT]
              ---------------------------------------------------------
              GMS: address is 10.11.12.157:1945 (cluster=DefaultPartition)
              ---------------------------------------------------------
              16:34:32,093 INFO [PlatformMBeanServerRegistration] JBossCache MBeans were succ
              essfully registered to the platform mbean server.
              16:34:34,046 INFO [DefaultPartition] Number of cluster members: 1
              16:34:34,046 INFO [DefaultPartition] Other members: 0
              16:34:34,468 INFO [RPCManagerImpl] Received new cluster view: [10.11.12.157:194
              5|0] [10.11.12.157:1945]


              • 4. Re: JBoss 5.1.0.GA. Why difference between -b and -Djboss.bi
                Brian Stansberry Master

                Hmm, I just noticed that last bit was running in an old pre-5.1.0.CR1 build. I'll try again.

                • 5. Re: JBoss 5.1.0.GA. Why difference between -b and -Djboss.bi
                  Brian Stansberry Master

                  Very strange. What I'm seeing is it works as expected when I set the properties on the command line, but when I edit run.conf.bat to include them in JAVA_OPTS, I get the behavior you reported.


                  Ah! I get it. The code that fixes the jgroups.bind_addr property if it's 0.0.0.0 is part of the processing of arguments passed to org.jboss.Main. But when you set it via JAVA_OPTS, that's passed to java directly, not as an argument passed to Main.

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

                  Thanks for the report.