4 Replies Latest reply on Apr 10, 2012 11:07 PM by mariani

    JBoss 7.0.2 binding to IP Address

    mariani

      Dear JBOSS User,

       

      I totally new in JBOSS.

       

      I setup JBOSS and want it run in standalone mode.

       

      I change the standalone.xml to bind to IP adress as follows :

      <interfaces>

          <interface name="management">

              <!--<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>-->

              <inet-address value="172.xx.xxx.xx"/>

          </interface>

          <interface name="public">

              <!--<inet-address value="${jboss.bind.address:127.0.0.1}"/>-->

              <inet-address value="172.xx.xxx.xx"/>

          </interface>

      </interfaces>

       

       

      As far as i know, this approach is not recommended.

      The other way to is add following lines in the configuration file in bin/standalone.conf property file.

      JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=172.xx.xxx.xx"

      JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.xx.xxx.xx

       

      I've tried the second way, modify the bin/standalone.conf but nothing happened. I cannot access http://172.xx.xxx.xx:8080/ only http://localhost:8080/

       

       

      Thank you for your answers.

       

      Regards,

       

       

      Mariani

       

       

       


        • 1. Re: JBoss 7.0.2 binding to IP Address
          peterj

          Are you running on Linux?

           

          When you run standalone, there should be a line like the following on the console. What IP address is given on your output?

           

          07:24:53,491 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--192.168.16.102-8080

           

          Also, the JAVA_OPTS settings are echoed, do the -D settings appear in that output?

           

          Finally, what happens if you run:

           

          ./standalone.sh -Djboss.bind.address=192.168.16.102
          • 2. Re: JBoss 7.0.2 binding to IP Address
            mariani

            Dear Peter,

             

            Thanks for your answer.

             

            My JBoss is running on windows (xp x64), but I planned to run on linux.

             

             

            This is what I got where running my standalone.bat

            08:18:44,807 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http--127.0.0.1-8090

             

            And when I run standalone.bat -Djboss.bind.address=172.16.122.194

            I got the following line

            08:25:30,432 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http--172.16.122.194-8090

             

             

            And here is my standalone.conf.bat configuration :

             

            ## -*- shell-script -*- ######################################################

            ## ##

            ##  JBoss Bootstrap Script Configuration ##

            ## ##

            ##############################################################################

             

            #

            # This file is optional; it may be removed if not needed.

            #

             

            #

            # Specify the maximum file descriptor limit, use "max" or "maximum" to use

            # the default, as queried by the system.

            #

            # Defaults to "maximum"

            #

            #MAX_FD="maximum"

             

            #

            # Specify the profiler configuration file to load.

            #

            # Default is to not load profiler configuration file.

            #

            #PROFILER=""

             

            #

            # Specify the location of the Java home directory.  If set then $JAVA will

            # be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".

            #

            #JAVA_HOME="/opt/java/jdk"

             

            #

            # Specify the exact Java VM executable to use.

            #

            #JAVA=""

             

            if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then

            JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"

            fi

             

            #

            # Specify options to pass to the Java VM.

            #

            if [ "x$JAVA_OPTS" = "x" ]; then

               JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

               JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"

            fi

             

            # Sample JPDA settings for remote socket debugging

            #JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

             

            # Sample JPDA settings for shared memory debugging

            #JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"

             

            # Allow JProfiler to find its classes

            #JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=com.jprofiler"

             

            # Use JBoss Modules lockless mode

            #JAVA_OPTS="$JAVA_OPTS -Djboss.modules.lockless=true"

             

            # congigure interface bind management

            JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=172.16.122.194"

            JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.16.122.194"

            • 3. Re: JBoss 7.0.2 binding to IP Address
              peterj

              And when I run standalone.bat -Djboss.bind.address=172.16.122.194

              I got the following line

              08:25:30,432 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http--172.16.122.194-8090

              Then you should be able to access http://172.16.122.194:8080 or http://hostname:8080 where hostname resolves to IP address 172.16.122.194. You will not be able to access http://localhost:8080

              1 of 1 people found this helpful
              • 4. Re: JBoss 7.0.2 binding to IP Address
                mariani

                Dear Peter,

                 

                Thanks for your answer again...

                 

                Finally I understand why I cannot bind with configuration...thanks to your clue

                 

                I make mistake with my configuration...in windows I should edit standalone.conf.bat not standalone.conf which is belong to linux.

                And the configuration would be like this for windows

                set "JAVA_OPTS=%JAVA_OPTS% -Djboss.bind.address.management=172.16.122.194"

                set "JAVA_OPTS=%JAVA_OPTS% -Djboss.bind.address=172.16.122.194"

                 

                Finally my JBoss can run on both Windows and Linux