4 Replies Latest reply on Apr 19, 2019 8:45 PM by lake

    windows services to start forms

    lake

      https://docs.oracle.com/en/middleware/lifecycle/12.2.1.3/asadm/starting-and-stopping.html#GUID-0A1802DC-DD3C-46B2-B91B-5…

      "However, that chapter describes the process for a standalone Oracle WebLogic Server installation. When Oracle WebLogic Server is part of an Oracle Fusion Middleware environment, you must set the environment to include references to ORACLE_COMMON."  That script has no reference to ORACLE_COMMON in there, mysteriously.

       

      I do not understand what we are trying to do here. If I use startWebLogic.cmd I end up with

      http://machine:7001/console and em

      and http://machine:9001  (forms)

      and Ohs1 at 777,4443,and 7779

       

      using this script below I ended up with nothing working right although it did install as a service.

       

      For one thing, is the admin server a "managed server"?  The terminology really escapes me. If this is starting the

      admin server then why are we telling it where the admin server is, if this is the admin server?  BTW I checked that the boot.properties file has been

      set and encrypted.

       

      echo off

      SETLOCAL

      set DOMAIN_NAME=base_domain

      set USERDOMAIN_HOME=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

      set SERVER_NAME=WeblogicAdmin

      set PRODUCTION_MODE=false

      set JAVA_OPTIONS=-Dweblogic.Stdout="%USERDOMAIN_HOME%\weblogicstdout.txt" -Dweblogic.Stderr="%USERDOMAIN_HOME%\weblogicstderr.txt"

      set ADMIN_URL=http://<ipnumber>:7001

      set MEM_ARGS=-Xms1024m -Xmx1024m

      call "%USERDOMAIN_HOME%\bin\setDomainEnv.cmd"

      call "c:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"

      ENDLOCAL

        • 1. Re: windows services to start forms
          Frank Hoffmann

          Lake,

           

          I you have a Windows2012/2016 Server you could simply start and stop the whole bunch of Services with a single Batch-File.

          Because of possible Windowsupdates I would postpone the start by 10 minutes. You can check this here:

           

          Startup.bat

          set  ipaddress=127.0.0.1
          set /a cport=5556
          set /a waittime=10
          set /a MaxLoops=180

          netstat -ano | findstr %ipaddress%:%cport% | findstr /R "LISTEN"
          if %ERRORLEVEL% NEQ 1 (
            @echo.
            @echo Nodemanager is already running
            @echo.
          ) ELSE (
            @echo on
            @echo.
            @echo Start NodeManager ...
            @echo.
            @echo off
            start startNodeManager
            call :waitfor %ipaddress% %cport%
            @echo on
            @echo successful!
            @echo off
          )

          :skipNodeManager

          set /a cport=7011
          netstat -ano | findstr %ipaddress%:%cport% | findstr /R "LISTEN"
          if %ERRORLEVEL% NEQ 1 (
            @echo.
            @echo WebLogic is already running
            @echo.
            GOTO :skipWebLogic)
          @echo on
          @echo.
          @echo Starte WebLogic ...
          @echo.
          @echo off
          start startWebLogic
          call :waitfor %ipaddress% %cport%
          @echo on
          @echo successful!
          @echo off
          :skipWebLogic

          set /a cport=9001
          netstat -ano | findstr %ipaddress%:%cport% | findstr /R "LISTEN"
          if %ERRORLEVEL% NEQ 1 (
            @echo.
            @echo WLS_FORMS laeuft schon
            @echo.
            GOTO :skipWLS_FORMS)
          @echo on
          @echo.
          @echo Starte WLS_FORMS ...
          @echo.
          @echo off
          start startManagedWebLogic WLS_FORMS
          call :waitfor %ipaddress% %cport%
          @echo on
          @echo erfolgreich!
          @echo off
          :skipWLS_FORMS

          set /a cport=9002
          netstat -ano | findstr %ipaddress%:%cport% | findstr /R "LISTEN"
          if %ERRORLEVEL% NEQ 1 (
            @echo.
            @echo WLS_REPORTS is already running
            @echo.
            GOTO :skipWLS_REPORTS)
          @echo on
          @echo.
          @echo Starte WLS_REPORTS ...
          @echo.
          @echo off
          start startManagedWebLogic WLS_REPORTS
          call :waitfor %ipaddress% %cport%
          @echo on
          @echo erfolgreich!
          @echo off
          :skipWLS_REPORTS

           

          start startcomponent REPSRV_APCSRV7_12213

          goto :ende

          rem
          rem Subroutine waitfor
          rem =============================================
          :waitfor
          @echo on
          @echo Waiting...
          @echo.
          @echo off
          set /a x=0
          set /a t=0
          :waitLoop
          netstat -ano | findstr %1:%2 | findstr /R "LISTEN"
          if %ERRORLEVEL% NEQ 1 GOTO :eof
          timeout /t %waittime% /NOBREAK 1>NULL
          set /a x=%x%+1
          set /a t=%t%+%waittime%
          @echo %t% Seconds waited...
          if %x% NEQ %MaxLoops% GOTO :waitloop
          @echo on
          @echo failed!
          @echo Max waiting time reached
          @echo off
          goto :fehler
          rem ============================================
          :fehler
          @echo Error occured
          exit /b 1
          :ende
          exit /b 0
          endLocal

          1 person found this helpful
          • 2. Re: windows services to start forms
            lake

            Thank you for your response. It is good to know there is at least one other person out there running this program!

            • 3. Re: windows services to start forms
              lake

              Ok I found some other docs about this (why oh why cannot not be one single set of correct instructions):

              https://docs.oracle.com/middleware/12213/wls/START/winservice.htm#START254

               

              which says:

              "To use this example script to set up an Administration Server as a Windows service, remove the ADMIN_URL variable."

              It also says:

              "Requiring Managed Servers to Start After Administration Servers

              If you set up both an Administration Server and a Managed Server to run as Windows services on the same computer, you can specify that the Managed Server starts only after the Administration Server."

               

              What we really need here are forms-specific instructions about the services needed. These instructions assume the customers know a lot of weblogic jargon, when all they want to do is get the product working so they can go on to the real job they are supposed to do, deploying forms.  And as to writing the unspecified java classes, that is ridiculous:

              "Create a Java class that invokes the weblogic.management.runtime.ServerRuntime.shutdown() method."

              Uh... each customer is supposed to write a java class to do a basic thing that all other windows software that runs as a service comes able to do? Absolutely bizarre.

              • 4. Re: windows services to start forms
                lake

                Ok this works.

                Note that the weblogic user and password is in this script. It was not finding the boot.properties apparently.

                Note that the server_name is AdminServer. Apparently is HAS to be that.

                Note that we are trying to install the admin server so we are NOT referring to another admin server (ADMIN_URL).

                Once you successfully installed your service you would of course need to start it in the services app.

                 

                rem echo off

                SETLOCAL

                set WLS_USER=weblogic

                set WLS_PW=<password>

                set DOMAIN_NAME=base_domain

                set USERDOMAIN_HOME=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

                set SERVER_NAME=AdminServer

                set PRODUCTION_MODE=false

                set JAVA_OPTIONS=-Dweblogic.Stdout="%USERDOMAIN_HOME%\weblogicstdout.txt" -Dweblogic.Stderr="%USERDOMAIN_HOME%\weblogicstderr.txt"

                set MEM_ARGS=-Xms1024m -Xmx1024m

                call "%USERDOMAIN_HOME%\bin\setDomainEnv.cmd"

                call "c:\Oracle\Middleware\Oracle_Home\wlserver\server\bin\installSvc.cmd"

                ENDLOCAL

                 

                BTW to delete a service that is not good on a windows server:

                sc query >myfile

                (find name of the service such as "wlsc base_domain_AdminServer"

                sc delete "service name"

                e.g.: sc delete "wlsc base_domain_AdminServer"