Sunday, July 14, 2013

Starting WebLogic as a Windows Service

WebLogic can be started by different ways and "Windows Service" is one of them.

If you check to create the service during the installation time a Windows service to start a weblogic domain will be created automatically, which we normally miss :)

So by following below steps you can create a Windows Service by which you can start a WebLogic server.

Install a weblogic instance (from 8.1 or above).

Now the script that help us do this process is "installSvc.cmd" which will be present under WL_Home\server\bin

We need to make a explicit script say "services.cmd" and it should contain the below configuration.

************************
echo off
SETLOCAL
call "\bin\setDomainEnv.cmd"
set DOMAIN_NAME=
set USERDOMAIN_HOME=
set SERVER_NAME=
set WLS_USER=
set WLS_PW=
set JAVA_OPTIONS=-Dweblogic.Stdout="\stdout.out"
-Dweblogic.Stderr="\stderr.txt" %JAVA_OPTIONS%
call "\server\bin\installSvc.cmd"
ENDLOCAL
************************

Description of the above script line by line.

First we call the setDomainEnv.cmd file which will set the environment.
Then we set the Domain name, domain location, which server we want to start via service, the username and password respectively.

Option "Dweblogic.Stdout" and "Dweblogic.Stderr" and not mandatory but is recommended to have it so that we will understand if there is any issue while executing the script or starting the server.
In the end we ill call "installSvc.cmd" and which will be creating a windows service.

Save the above file as a ".cmd" file and run it.

A new service called "bea__Domain__ServerNmae" will get created.And start the service.


That's it you service has been created successfully.

If you make the service run "Automatically" then the server will startup when ever you start your Operating System.

No comments:

Post a Comment