Run WebLogic as a Windows service

If you want a WebLogic Server instance to start automatically when you boot a Windows host computer, you can set up the server as a Windows service.

On Windows computers, you can run the WebLogic server as a Windows service and can start/stop WebLogic server from the Services window.

Below are the steps to install WebLogic service:

1. Go to D:\Oracle\Middleware\user_projects\epmsystem1\bin and create a text document with the below contents:

Save the file and rename it to Start_WL_Admin_Server.cmd. (Save the text file with a .cmd extension. By default, the Windows command prompt associates the .cmd extension with batch files)

Below is the reference of what has been used in the above script:

  • SETLOCAL: This is a batch command that begins the localization of environment variables in a batch file.
  • set DOMAIN_NAME=domain-name: Where domain-name is the name of your WebLogic Server domain.
  • set USERDOMAIN_HOME=absolute-pathname: Where absolute-pathname is the absolute pathname of the Administration Server's root directory.
  • set SERVER_NAME=server-name: Where server-name is the name of an existing server instance that you want set up as a Windows service.
  • set WL_HOME: Directory in which you installed WebLogic Server.
  • set PRODUCTION_MODE=[true]: When the PRODUCTION_MODE variable is set to true, the server instance starts in production mode. When not specified, or when set to false, the server starts in development mode. 
  • set WLS_USER=username: Where username is the name of an existing user with privileges to start a server instance.
  • set WLS_PW=password: Above user's password.
  • set MEM_ARGS=[-XmsNumberm] [-XmxNumberm]: Where Numberm is a numerical value in megabytes (MB). The-XmsNumberm argument establishes a minimum heap size for the JVM and the -XmxNumberm sets a maximum heap size. By default, the minimum heap size is 23 MB and the maximum heap size is 200 MB.
  • call: Calls the mentioned scripts.
  • ENDLOCAL: This is a batch command that ends the localization of environment variables in a batch file.

2. Double-click on this file to run it, a Windows Service will be created - named wlsvc EPMSystem_AdminServer.


Below are the steps to uninstall WebLogic service:

1. Go to D:\Oracle\Middleware\user_projects\epmsystem1\bin and create a text document with the below contents:

2. Double-click on the file just created to run it, and the  WebLogic Windows Service will be uninstalled from your system.

That's all! Thank you!

Comments