5 Replies Latest reply on Mar 1, 2011 3:25 PM by Manny Joe

    Localhost works but not otherwise

    Manny Joe Newbie

      Hello

      I just started with JBOSS recently, so a complete newbie.

      My appication creates a ear file, which i need to depoy to JBOSS_HOME\server\<myconfig>\deploy.

       

      If I start the jboss from cmd prompt using run.bat -b hostname, I could login to the server from any host. http://hostname:8080.

       

      Now I wanted to create a service for this. I used jbosssvc.exe and used service. bat and run.bat to configure it. But now, when i start teh service, I could only use http://localhost:8080/ but not http://hostname:8080

       

      Any idea, where I need to modify in which XML file, since there is a lot.

       

      Thanks.

        • 2. Localhost works but not otherwise
          Manny Joe Newbie

          THis is a snapshot of service.bat. So are you saying that I need to include "-b 0.0.0.0" at this line at service.bat?

           

          call run.bat  -b 0.0.0.0< .r.lock >> run.log 2>&1

           

           

          ==================

           

          @echo off

          REM JBoss, the OpenSource webOS

          REM

          REM Distributable under LGPL license.

          REM See terms of license at gnu.org.

          REM

          REM -------------------------------------------------------------------------

          REM JBoss Service Script for Windows

          REM -------------------------------------------------------------------------

           

           

          @if not "%ECHO%" == "" echo %ECHO%

          @if "%OS%" == "Windows_NT" setlocal

          set DIRNAME=%CD%

           

          REM

          REM VERSION, VERSION_MAJOR and VERSION_MINOR are populated

          REM during the build with ant filter.

          REM

          set SVCNAME=JBAS50SVC

          set SVCDISP=JBoss Application Server 5.0

          set SVCDESC=JBoss Application Server 5.0.0 GA/Platform: Windows x86

          set NOPAUSE=Y

           

          REM Suppress killing service on logoff event

          set JAVA_OPTS=-Xrs

           

          REM Figure out the running mode

           

          if /I "%1" == "install"   goto cmdInstall

          if /I "%1" == "uninstall" goto cmdUninstall

          if /I "%1" == "start"     goto cmdStart

          if /I "%1" == "stop"      goto cmdStop

          if /I "%1" == "restart"   goto cmdRestart

          if /I "%1" == "signal"    goto cmdSignal

          echo Usage: service install^|uninstall^|start^|stop^|restart^|signal

          goto cmdEnd

           

          REM jbosssvc retun values

          REM ERR_RET_USAGE           1

          REM ERR_RET_VERSION         2

          REM ERR_RET_INSTALL         3

          REM ERR_RET_REMOVE          4

          REM ERR_RET_PARAMS          5

          REM ERR_RET_MODE            6

           

          :errExplain

          if errorlevel 1 echo Invalid command line parameters

          if errorlevel 2 echo Failed installing %SVCDISP%

          if errorlevel 4 echo Failed removing %SVCDISP%

          if errorlevel 6 echo Unknown service mode for %SVCDISP%

          goto cmdEnd

           

          :cmdInstall

          jbosssvc.exe -imwdc %SVCNAME% "%DIRNAME%" "%SVCDISP%" "%SVCDESC%" service.bat

          if not errorlevel 0 goto errExplain

          echo Service %SVCDISP% installed

          goto cmdEnd

           

          :cmdUninstall

          jbosssvc.exe -u %SVCNAME%

          if not errorlevel 0 goto errExplain

          echo Service %SVCDISP% removed

          goto cmdEnd

           

          :cmdStart

          REM Executed on service start

          del .r.lock 2>&1 | findstr /C:"being used" > nul

          if not errorlevel 1 (

            echo Could not continue. Locking file already in use.

            goto cmdEnd

          )

          echo Y > .r.lock

          jbosssvc.exe -p 1 "Starting %SVCDISP%" > run.log

          call run.bat < .r.lock >> run.log 2>&1

          jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> run.log

          del .r.lock

          goto cmdEnd

           

          :cmdStop

          • 4. Localhost works but not otherwise
            Wolf-Dieter Fink Master

            Yes, -b 0.0.0.0 will bind against all network interfaces.

            In this case you are able to use localhost or <your IP> to connect