Oracle WebLogic servers can be started up as MS Windows Services upon system startup. NOTE: Configuring Node Manager is still the preferred method as Node Manager also is able to restart a Weblogic server if a server crashes. To install Windows services to start up the servers, you can follow these steps:

  1. Make sure each Weblogic server has boot.properties consisting of the Weblogic username and password in the %DOMAIN_HOME%\servers\server_name\security folder.
  2. For the Admin Server, create a file called installAdmServer_Service.cmd (the name of the file can be different).
  3. Edit the file using a text editor. Add in the following lines:
    • SETLOCAL
      set DOMAIN_NAME=FormsDomain
      set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\FormsDomain
      set SERVER_NAME=AdminServer
      set PRODUCTION_MODE=true
      cd %USERDOMAIN_HOME%
      call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
      call “C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd”
      ENDLOCAL
  4. Run installAdmServer_Service.cmd. A service called “beasvc FormsDomain_AdminServer” should be created.
  5. In “Services”, start the “beasvc FormsDomain_AdminServer” service. After waiting about 2-3 minutes, check to see if the server is running.
  6. For the WLS_FORMS server, create a file called installWLSFORMS_Service.cmd (the name of the file can be different).
  7. Edit the file using a text editor. Add in the following lines:
    • SETLOCAL
      set DOMAIN_NAME=FormsDomain
      set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\FormsDomain
      set SERVER_NAME=WLS_FORMS
      set PRODUCTION_MODE=true
      set ADMIN_URL=http://name_of_machine:7001
      cd %USERDOMAIN_HOME%
      call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
      call “C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd”
      ENDLOCAL
  8. Run installWLSFORMS_Service.cmd. A service called “beasvc FormsDomain_WLS_FORMS” should be created.
  9. In “Services”, start the “beasvc FormsDomain_WLS_FORMS” service. After waiting about 2-3 minutes, check to see if the server is running.
  10. Repeat steps 6-9 using WLS_REPORTS. Make sure all three services are set to “Automatic”.
  11. Test to see if the servers automatically start up by performing a system reboot. NOTE: After the system reboots, the services may start up to five minutes later.

 

ALERT FOR SOME WEBLOGIC ENVIRONMENTS (All sections below added November 22, 2013)

There have been reports that when creating the WebLogic startup services that the WebLogic servers fail to start up due to the errors presented in %WLS_SERVER%.log:

java.lang.OutOfMemoryError: PermGen space

Caused by: java.lang.OutOfMemoryError: PermGen space

To fix the problem, open up installSvc.cmd located in %MW_HOME%\wlserver_10.3\server\bin (make a backup first) and make the following changes:

Comment out: call “%WL_HOME%\common\bin\commEnv.cmd”

and add:

  • set MW_HOME=LOCATION_TO_MIDDLEWARE_HOME
  • call %MW_HOME%\user_projects\domains\NAME_OF_DOMAIN\bin\setDomainEnv.cmd (where NAME_OF_DOMAIN is the name of your WebLogic domain)

image

Save and close the file.

IMPORTANT: When editing installSvc.cmd, be sure that Word Wrap is turned off to avoid file corruption! Also, it is important to have a backup of this file at all times!

Uninstall any existing Windows Services that you created for WebLogic. You should be able to successfully create the services and start up the WebLogic servers without failure.

Source: Oracle Support Note 1312573.1

NOTE: If you encounter an error saying “The input line is too long”, this may indicate that the CLASSPATH variable is too long to be used in installSvc.cmd. To fix this issue, please follow the steps below:

  1. Open up Command Prompt and cd to %DOMAIN_HOME%\bin
  2. For starting up:
    • AdminServer – Run:
      • setDomainEnv.cmd
    • WLS_FORMS, WLS_REPORTS, WLS_DISCO – Run:
      • set SERVER_NAME=WLS_SERVER_NAME
      • setDomainEnv.cmd
  3. cd bin
  4. Run:
    • echo %CLASSPATH% > classpath.txt
  5. Open up installSvc.cmd from before.
  6. Scroll to the bottom of the file. Look for two lines which start with “set CMDLINE…” Notice an environment variable CLASSPATH after the –classpath flag. Replace the variable with the full path to the classpath.txt file.
    • Example: –classpath @c:\Oracle\Middleware\user_projects\domains\FormsDomain\bin\classpath.txt
    • image
  7. Save and close the file.
  8. Run the cmd script you originally created to create the Windows services and run one of them at a time.
  9. Repeat steps 1-8 for other WebLogic servers you wish to create Windows Services for.

Sources: Oracle Support note 1312573.1 and http://docs.oracle.com/cd/E17904_01/web.1111/e13708/winservice.htm#i1188175

 

Alert for WLS_REPORTS (Added November 26, 2013):

There is a known issue where even with the above fix that WLS_REPORTS will fail to come up 100% after a server reboot. For example, in WLS_REPORTS.log, an error may appear showing:

<Error> <Deployer> <ams-fp-wlsp02> <WLS_REPORTS> <[ACTIVE] ExecuteThread: ‘9’ for queue: ‘weblogic.kernel.Default (self-tuning)’> <<WLS Kernel>> <> <> <1385156762247> <BEA-149205> <Failed to initialize the application ‘reports [Version=11.1.1.2.0]’ due to error weblogic.management.DeploymentException: .

To fix the issue, you may follow these steps below:

  1. Uninstall the Windows service for starting up WLS_REPORTS (Shut down WLS_REPORTS first as it is running in a failed state)
  2. Start WLS_REPORTS manually.
  3. Check in WLS_REPORTS.log (%DOMAIN_HOME%\servers\WLS_REPORTS\logs) and search for “java.class.path” in the file (check near the very end of the log file to obtain the most recent value).
  4. Copy the value of java.class.path and paste it into the classpath.txt file.
  5. Recreate the Windows service for WLS_REPORTS and test.

After applying the steps above, WLS_REPORTS should be able to start normally including after a server reboot.

Source: Oracle Support note 1339871.1