9 Replies Latest reply on Jul 2, 2008 6:36 AM by gan.gary

    Remote conenct JBoss AS

    gan.gary

      I tried to Remote conenct JBoss AS, but unavail ( cannot see JMX console). I already turn-off fire wall on both sides. Do I need to add port (8080) even turn-off firewall? If add program, what program needs to be added? run.bat?

        • 1. Re: Remote conenct JBoss AS
          jaikiran

          Start JBoss with -b option. See this for more details http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss42FAQ

          • 2. Re: Remote conenct JBoss AS
            gan.gary

            it only mentioned using as normal app. what If my JBoss set as JBoss Native windows service? Do i need to modify "service.bat"?

            :cmdInstall
            jbosssvc.exe -imwdc %SVCNAME% "%DIRNAME%" "%SVCDISP%" "%SVCDESC%" service.bat
            if not errorlevel 0 goto errExplain
            echo Service %SVCDISP% installed
            goto cmdEnd


            • 3. Re: Remote conenct JBoss AS
              jaikiran

              service.bat acts just like a wrapper over the run.bat. So edit your service.bat to include the -b option as follows:

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



              :cmdRestart
              REM Executed on service restart
              REM Note. We can only stop and start
              call shutdown -S >>shutdown.log
              call run.bat -b 0.0.0.0 >>run.log
              goto cmdEnd
              


              • 4. Re: Remote conenct JBoss AS
                gan.gary

                 

                "jaikiran" wrote:
                service.bat acts just like a wrapper over the run.bat. So edit your service.bat to include the -b option as follows:

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



                :cmdRestart
                REM Executed on service restart
                REM Note. We can only stop and start
                call shutdown -S >>shutdown.log
                call run.bat -b 0.0.0.0 >>run.log
                goto cmdEnd
                


                thanks!
                cmdRestart? I found the places call the "run.bat" is on:

                :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

                :
                waitRun
                REM Delete lock file
                del .r.lock > nul 2>&1
                REM Wait one second if lock file exist
                jbosssvc.exe -s 1
                if exist ".r.lock" goto waitRun
                echo Y > .r.lock
                jbosssvc.exe -p 1 "Restarting %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

                why on cmdRestart?

                • 5. Re: Remote conenct JBoss AS
                  gan.gary

                  even I removed & re-installed & changed to this:

                  :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 -b 0.0.0.0 < .r.lock >> run.log 2>&1
                  jbosssvc.exe -p 1 "Shutdown %SVCDISP% service" >> run.log
                  del .r.lock
                  goto cmdEnd


                  also cannot.

                  • 6. Re: Remote conenct JBoss AS
                    jaikiran

                    The contents from service.bat that i posted were from an older version of JBossNative. For the version you are using, the service.bat has to be edited as follows:

                    :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 -b 0.0.0.0 >> run.log 2>&1
                    .....
                    ......
                    some more lines from the bat file
                    
                    ....
                    ....
                    :cmdRestart
                    REM Executed manually from command line
                    REM Note: We can only stop and start
                    echo Y > .s.lock
                    jbosssvc.exe -p 1 "Shutting down %SVCDISP%" >> shutdown.log
                    call shutdown -S < .s.lock >> shutdown.log 2>&1
                    del .s.lock
                    :waitRun
                    REM Delete lock file
                    del .r.lock > nul 2>&1
                    REM Wait one second if lock file exist
                    jbosssvc.exe -s 1
                    if exist ".r.lock" goto waitRun
                    echo Y > .r.lock
                    jbosssvc.exe -p 1 "Restarting %SVCDISP%" >> run.log
                    call run.bat < .r.lock -b 0.0.0.0 >> run.log 2>&1
                    


                    • 7. Re: Remote conenct JBoss AS
                      gan.gary

                      why

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

                      instead of

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


                      • 8. Re: Remote conenct JBoss AS
                        jaikiran

                        Both work

                        • 9. Re: Remote conenct JBoss AS
                          gan.gary

                          great, thanks!. You solved my problem. I found my problem is casued by IP problem.