Wednesday, April 6, 2011

Install / Uninstall WebLogic as Windows Service

Hello Guys,

In this post we discuss about Installing and Uninstalling WebLogic as Windows Service. Here its tried on WebLogic 10.3.3, Please let me know if you face any issues following this article.

Assume you have following properties set at Windows XP/Any Operating System.

WebLogic Home : C:\Oracle\Middleware\wlserver_10.3
Domain Home : C:\Oracle\Middleware\user_projects\domains\TestDomain
Server Name : AdminServer

Installing WebLogic as Windows Service

Create a batch file called : Service.bat with following contents.

echo off
SETLOCAL

set DOMAIN_NAME=
TestDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\TestDomain
set SERVER_NAME=AdminServer

call "
C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"

ENDLOCAL


Note : If you would like to troubleshoot on this, please specify the -log parameter in the installSvc.cmd file as below. 


"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -log:"D:\WinService.log" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE%

by this if you see any issues while you setup or after you have setup the windows service, you will be able to troubleshoot over the same.

Note : Specify the variables values accordingly, and for managed server you need to use the script installSvc-Managed.cmd in place of installSvc.cmd

And Execute the file in command window or just a Double Click

It will install the WebLogic Server Windows Service With the Name : "TestDomain_AdminServer", however you change the name with the help of editing the script of installSvc.cmd / installSvc-Managed.cmd.

Uninstalling WebLogic as Windows Service :

In this Scenario we have to create the same script with little modifications as below :

echo off
SETLOCAL

set DOMAIN_NAME=
TestDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\TestDomain
set SERVER_NAME=AdminServer

call "
C:\Oracle\Middleware\wlserver_10.3\server\bin\uninstallSvc.cmd"

ENDLOCAL


Note : Same script here (uninstallSvc.cmd) goes for Uninstalling WebLogic Service for Admin Server as well as Managed Server.

Execute the script with a double click or in command shell, it will remove the service what you have specified with the name as "TestDomain_AdminServer"  or if you have any custom name, you can set it in uninstallSvc.cmd file.

Please let me know if you have any kind of difficulty in following this article.

Thanks
Shailesh Dyade

1 comment:

Unknown said...


Hi please help me
Look at this:
echo off
SETLOCAL
set DOMAIN_NAME=base_domain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\base_domain
set SERVER_NAME=AdminServer
set WLS_USER=weblogic
set WLS_PW=MEDELLIN1*
set PRODUCTION_MODE=true
set JAVA_OPTIONS=-Xms256m -Xmx512m -XX:MaxPermSize=256m -XX:+UseSpinning -Dweblogic.Stdout="C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\logs\stdout.txt" -Dweblogic.Stderr="C:\Oracle\Middleware\user_projects\domains\base_domain\servers\AdminServer\logs\stderr.txt"
set MEM_ARGS=-Xms40m -Xmx250m
set ADMIN_URL=http://HAZOR:7001
set PORTS=7001
call "C:\Oracle\Middleware\user_projects\domains\base_domain\bin\setDomainEnv.cmd"
call "C:\Oracle\Middleware\wlserver\server\bin\installSvc.cmd"
ENDLOCAL

when start the services:

---------------------------
Services
---------------------------
The AdminServerGIS_AdminServer service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
---------------------------
OK
---------------------------

thanks,
best regards