Adsense Ad

Automating Oracle FMW services as Windows Services



Automating Weblogic Admin Server, WLS_FORMS(Forms Server), WLS_REPORTS(Reports server) startup with Windows Services





Let us agree, the cmd windows look ugly, dangerous and a user can close them down, thus bringing the entire servers down unintentionally. A windows service looks much favorable under such scenarios and wise people from Oracle do provide solutions to create windows services for
  1. Weblogic Admin Server
  2. WLS_FORMS (Forms Server)
  3. WLS_REPORTS (Reports Server)
Creating Windows services for Admin Server and Forms server are pretty simple and straight forward business, while CMD command line length limitations will make Reports Server service creation a little difficult, don’t worry we have solution for it also.

A – Creating boot.properties

Pre-requisite(s)
Notepad++ (or any decent text editor other than Windows notepad)
Create a boot.properties file with the following lines

--------------------

username:<your weblogic username>
password:<your weblogic password>

--------------------

Save the script to “USERDOMAIN_HOME” folder, ie, 
Copy to: C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\security
Copy to: C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_FORMS\security
Copy to: C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_REPORTS
 in our case From elevated command line.




B – Creating Windows Service for Weblogic Admin Server

Pre-requisite(s)
Notepad++ (or any decent text editor other than Windows notepad)
Create a .cmd file named “Install_AdminServer.cmd” with the following lines

--------------------

SETLOCAL
set DOMAIN_NAME=ClassicDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\ClassicDomain
set SERVER_NAME=AdminServer
set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
set PRODUCTION_MODE=true
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
rem *** call "C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"
call "%WL_HOME%\server\bin\installSvc.cmd"
ENDLOCAL

-------------

Please note, you must provide the absolute domain name and physical directory names based on your installation preferences!
Save the script to “USERDOMAIN_HOME” folder, ie, “C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\AdminServer\security” in our case
From elevated command line, execute the batch file, and the Windows service for Admin Server must be created, unless there were mismatches with the information supplied.




C – Creating Windows Service for WLS_FORMS(Forms Server)
Create a .cmd file “InstallWLS_FORMS.cmd” using Notepad++ with following lines

------------------------------

SETLOCAL
set DOMAIN_NAME=ClassicDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\ClassicDomain
set SERVER_NAME=WLS_FORMS
set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
set PRODUCTION_MODE=true
set ADMIN_URL=http://localhost:7001
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
rem *** call "C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"
call "%WL_HOME%\server\bin\installSvc.cmd"
ENDLOCAL

--------------------------

Save the script to “USERDOMAIN_HOME” folder, ie, “C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_FORMS\security” in our case
From elevated command line, execute the batch file, and the Windows service for WLS_FORMS must be created, unless there were mismatches with the information supplied


D – Creating Windows Service for WLS_REPORTS(Reports Server)
Create a .cmd file “InstallWLS_REPORTS.cmd” using Notepad++ with following lines

------------------------

SETLOCAL
set DOMAIN_NAME=ClassicDomain
set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\ClassicDomain
set SERVER_NAME=WLS_REPORTS
set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
set PRODUCTION_MODE=true
set ADMIN_URL=http://localhost:7001
cd %USERDOMAIN_HOME%
call %USERDOMAIN_HOME%\bin\setDomainEnv.cmd
rem *** call "C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"
call "%WL_HOME%\server\bin\installSvc.cmd"
ENDLOCAL

----------------------

Unfortunately, you cannot just run the .cmd file and create a service for WLS_REPORTS like other services, as the java CLASSPATH for reports server has more than 3000 character length, which is beyond 32Bit command line architecture.

Hence you have to do a minor hack, as provided as a solution by Oracle.
Go to “C:\Oracle\Middleware\wlserver_10.3\server\bin” folder (equivalent on your machine) and
make a backup for the file “InstallSvc.cmd”

If the report server is running, terminate it by using Ctrl+C within the open cmd window Wait until the server shutdown. Check the status through Admin Console.

Now restart the Report Server, using the menu interface


Mark and copy the CLASSPATH= output and paste it to a new text document. You have to spend few minutes to wrap up the text and make sure the entire text is wrapped into a single line (This is why we love Notepad++)


Add “set” in front of CLASSPATH= and your txt file content should look something like below and save the text file as “myClasspath.txt”
For Example:

Now open the “InstallSvc.cmd” using Notepad++ and locate the line “set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%” and comment the same like
rem *** set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%
Now locate the line “set CMDLINE” within the “InstallSvc.cmd” and change the line like following
For Example:

There are two instances of set CMDLINE, you must change both lines, only replacing the “-classpath \”%CLASSPATH%\” part with -classpath @d:\myClasspath.txt
After the above, from elevated command line, execute the batch file, and the Windows service for WLS_REPORTS must be created, unless there were mismatches with the information supplied



Change “Automatic” to “Manual” for better ease, at various situations. You may create a .cmd file for starting the services and another one for stopping them.
From our prospects, these services are just a facelift for the batch files, avoiding the immediate problems with accidental closure of cmd windows and thus causing serious issues to the instance. We came to this conclusion because, the service status are not updated incase if one of the services stopped by the Admin Server console at later stages, neither the service status update waits until the actual server starts to update  state of the service.

You can delete whole these service from command prompt, after stopping like following

>SC DELETE “service name”

We hope you will enjoy setting up Weblogic 10.3.6 and Oracle Forms and Reports 11g Release 2 on Windows following the instruction set provided above.

Download Package


8 comments:

Unknown said...

Please how to do this with enterprise management agent uninstalled

A.Ghani Kamani said...

it is not making my WLS_FORMS service.... Run as administrator window opens and close where to check for errors please help!!!

mahmoud elhossary said...

sir , after i created WLS_FORMS service the ole2 package does not work pleas how can i solve this problem ? .

Technoloy Sense said...

WHAT ARE SAME PROCESS USE FOR 12C FORM SERVICES ????

Anonymous said...

How to start OHS server as a windows service?
and is it required to add node manager also as a windows service?

Fahd said...

there is a typing mistake in your blog
following path is not complete
C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_REPORTS
should be
C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_REPORTS\security

Anonymous said...

Worked fantastic for my environment! Since I used all the defaults on installation, but installed the software to a "D" drive, all I needed to do was change everything from "C" to "D". We don't use Reports, so I just ran the steps for Administration and WLS_FORMS. I rebooted the server, waited about 4 minutes for everything to start up, and was up and running. Super clear and straightforward instructions. Thank you so much for posting this information!!

Anonymous said...

Dear Hassan Javaid,

I am running a report from 11g report builder using web layout but now running. what will be the issue....