9 Replies Latest reply on Nov 3, 2011 3:27 AM by mailpgarg

    bind address for jboss services

      New to JBoss, installed and run using run.bat in WinXP. First of all, encountered problem that only local access works, access from other PC didn't work. Read some posting here and found that can be resolve with

      run.bat -b 0.0.0.0
      

      Tried and now it works for both local and remote.

      Recently, trying to start JBoss as win service using JavaService as stated in the Getting Started Guide. Installed the service without problem, but it has same problem as before: local ok, remote no. Of course, there is no "-b 0.0.0.0" in the service's command line. So I tried to add the parm to windows service but failed, I can type it in but cannot save. I then looked up manual of JavaService, added this to the install batch file
      JBossService.exe -install JBoss.............-start org.jboss.Main -params "-b 0.0.0.0" -stop ........
      

      The service installed and started ok. My war file also deploys ok and works for both local and remote. But there are problems in the boot log:
      ....
      10:13:02,930 INFO [ServiceConfigurator] Problem configuring service jboss:service=WebService
      org.jboss.deployment.DeploymentException: Exception setting attribute BindAddress = 0.0.0.0 on mbean jboss:service=WebService; - nested throwable: (java.net.UnknownHostException: 0.0.0.0)
       at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:707)
      ..........
      

      And same problem for Naming service below it.

      If it is not run as service, but run from command line, with "-b 0.0.0.0", it does not have these problems:
      10:02:46,175 DEBUG [ServiceCreator] Created bean: jboss:service=WebService
      10:02:46,175 DEBUG [ServiceConfigurator] BindAddress set to 0.0.0.0 in jboss:service=WebService
      10:02:46,175 DEBUG [ServiceConfigurator] Port set to 8083 in jboss:service=WebService
      10:02:46,175 DEBUG [ServiceConfigurator] Host set to pc104022 in jboss:service=WebService
      10:02:46,191 DEBUG [ServiceConfigurator] DownloadServerClasses set to true in jboss:service=WebService
      10:02:46,191 DEBUG [ServiceConfigurator] DownloadResources set to false in jboss:service=WebService
      10:02:46,191 DEBUG [ServiceController] recording that jboss:service=WebService depends on jboss.system:service=ThreadPool
      10:02:46,191 DEBUG [ServiceConfigurator] considering ThreadPool with object name jboss.system:service=ThreadPool
      

      Anybody know what's wrong with my service??

        • 1. Re: bind address for jboss services
          jaikiran

          Edit the service.bat file to add the -b option as below.

          :cmdStart
          REM Executed on service start
          call run.bat -b 0.0.0.0 >run.log
          goto cmdEnd


          You need to do the same in the cmdStop and cmdRestart sections.


          • 2. Re: bind address for jboss services

            Thanks for the reply.

            I do not have any service.bat in my bin folder. Mine may not be the native Windows JBoss. I couldn't remember if I saw any word "native" when I download. ALso, I have some *.sh file in the bin.

            If I want to stay with this JBoss, how can I do the same in JBoss or JavaService?

            • 3. Re: bind address for jboss services
              peterj

              Are you using the tool from http://javaservice.objectweb.org/? I ask because there are several tools called Java Service and each is configured differently.

              If you are, that tool stores service configuration information in the Windows registry. Check the settings at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XXX\Parameters, where XXX is your service name. You should have some settings that look like this:

              Start Param Count REG_DWORD 0x00000002 (2)
              Start Param Number 0 Reg_SZ -b
              Start Param Number 1 Reg_SZ 0.0.0.0


              If that is not what you have, correct it using regedit.

              By the way, this tool is not recommended for use with JBossAS. See the "JavaService is no longer recommended" section of this wiki page for the reasons: http://www.jboss.org/community/docs/DOC-11932


              • 4. Re: bind address for jboss services
                yamajako

                I have the exact same problem and tried your solution but it didn't work.

                Does anyone have any idea why the -b 0.0.0.0 works when we run jboss via run.bat and not with JavaService even though both call org.jboss.Main with the same parameters ?

                I know this is a really old topic but I'd be grateful for any help

                Thanks

                • 5. Re: bind address for jboss services
                  peterj

                  Since you did not post your JavaService configuration, all I can assume is that you configured it wrong and the '-b 0.0.0.0' is not actually being passed.

                   

                  And you apparently did not read my prior post because you ignored this question (you never said which JavaServer you are using - giving a URL helps):

                  >>Are you using the tool from http://javaservice.objectweb.org/? I ask because there are several tools called Java Service and each is configured differently.

                  • 6. Re: bind address for jboss services
                    yamajako

                    Sorry

                    I am using javaservice from the website you pointed to and as for my javaservice configuration here it is:

                     

                    set javadll=%JAVA_HOME%\jre\bin\client\jvm.dll
                    set javatool=%JAVA_HOME%\lib\tools.jar
                    set javarun=%JBOSS_HOME%\bin\run.jar
                    set outlog=%JBOSS_HOME%\stdout.log
                    set errlog=%JBOSS_HOME%\stderr.log

                     

                     

                     

                    %JBOSS_HOME%\bin\JavaService.exe -install JBoss "%javadll%" "-Xms512m" "-Xmx512m" -Djava.class.path="%javatool%";"%javarun%" -start org.jboss.Main -method main -params "-b 0.0.0.0" -stop org.jboss.Main -method systemExit -out "%outlog%" -err "%errlog%" -current "%JBOSS_HOME%\bin" -auto

                     

                    When the service is started, Jboss outputs this exception :

                    [ServiceConfigurator] Problem configuring service jboss:service=WebService
                    org.jboss.deployment.DeploymentException: Exception setting attribute BindAddress =  0.0.0.0 on mbean jboss:service=WebService; - nested throwable: (java.net.UnknownHostException:  0.0.0.0)

                     

                    Any ideas ?

                    • 7. Re: bind address for jboss services
                      peterj

                      What you posted is the service installation command. What you should have posted is the registry key that configures the service. You need to check the registry key that I posted, looking for the entries I posted. If that doesn't help you, then export that registry key and post the .reg file.

                      • 8. Re: bind address for jboss services
                        yamajako

                        Just in case somebody is having the same issue. I gave up JavaService to use jboss native and managed to get the behaviour I wanted by using:

                        -Djava.rmi.server.hostname=172.21.100.230 -Dremoting.bind_by_host=false it might work directly with JavaService but I haven't tested it myself

                        • 9. Re: bind address for jboss services
                          mailpgarg

                          I removed the space in between and it worked for me. That is -params -b0.0.0.0. Otherwise all the URLs become http:// 0.0.0.0:port