Setting up OEID 3.x as a Windows Service

Sorry for the long absence. I’ve been working less with EID in the past while and found myself too busy to post things. However I recently had a task at a client to setup their installation of Oracle EID 3.1 as Windows Services. This included OES, Studio, Provisioning Services and IAS, but the steps are virtually identical for all of them. Oracle has all this documented, but I found some gaps so here all the details to do this for you.

  1. If you are going to run the service under a network account, make sure that account has full control to the Weblogic folder (e.g. C:\Oracle\Middleware\).
  2. Copy these two files:
    1. C:\Oracle\Middleware\wlserver_10.3\common\bin\commEnv.cmd
    2. C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd
  3. Rename the copies as follows:
    1. C:\Oracle\Middleware\wlserver_10.3\common\bin\comEnv_oes.cmd
    2. C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc_oes.cmd
  4. Open up the file startWebLogic.cmd, this is the file that executes when you manually start OES, in a folder like this:
    1. C:\Oracle\Middlware\user_projects\domains\oes_domain\bin\
    2. Comment out the two lines starting with %JAVA_HOME% (around lines 175 & line 178) with “@rem “. One of these two lines executes to start up the domain application.
    3. Below (or above) each add the following lines:
    @echo MEM_ARGS: %MEM_ARGS%

    Note : you can optionally echo out the entire line be using @echo instead of @rem, but I found it helpful to focus in on those specific variables

  5. From a command prompt execute startWebLogic.cmd, make note of the values output for those three variables. These reflect YOUR environment and you’ll need them later on.
  6. Edit the file startWebLogic.cmd file to undo your changes and remove any lines you added.
  7. Edit the file commEnv_oes.cmd file as follows:
    1. Update the following line (around line 144):
      set JAVA_VM=-server

      Note: “-client” doesn’t seem to be recognized by beasvc, perhaps the assumption is you wouldn’t set up the windows service if you were implementing in Development mode.

    2. Add the following line in the “:continue” block (around line 155):
      set MEM_ARGS=-Xms128m –Xmx3072m –XX:CompileThreshold=8000 –XX:PermSize=128m –XX:MaxPermSize=512M

      Note: this should reflect whatever values were output when you executed StartWebLogic earlier, those happen to be the values for my environment, they may not be the same for yours

  8. Edit the file installSvc_oes.cmd as follows:
    1. Update the following line (around line 58)
      call “%WL_HOME%\common\bin\commEnv_oes.cmd
    2. Go to the section “:runAdmin” (around line 110)
    3. Add a line to append the CLASSPATH variable with additional references needed for the WebLogic support classes:
      set CLASSPATH=%CLASSPATH%;C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\Oracle\MIDDLE~1\WLSSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar

      Note: This amendment reflects what startWebLogic.cmd output that the CLASSPATH variable was otherwise missing. It may differ for your site.

    4. Update the cmdline assignment to remove some escaped quotations around CLASSPATH and MEM_ARGS
      set CMDLINE=’%HAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath %CLASSPATH% -Dweblogic.Name=%SERVER_NAME%\”%ADMIN_URL%\” –Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%\server\lib\weblogic.policy\weblogic.Server”

      Note: Full disclosure I don’t think this was actually necessary, but when I was checking the final cmdline statement there were some odd quotation marks showing up and since I had no spaces to worry about I opted to remove them altogether just in case.

  9. Create a file called OES_Service.cmd as follows:
echo off
set DOMAIN_NAME=oes_domain
set USERDOMAIN_HOME=C:\Oracle\MIDDLE~1\USER_P~1\domains\OES~DO~1
set SERVER_NAME=AdminServer
set WL_HOME=C:\Oracle\MIDDLE~1\WLSERV~1.3
set WLS_USER=weblogic
set WLS_PW=yourPassword
set JAVA_OPTIONS= -Xverify:none –da –Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 … -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\sysext_manifest_classpath

Note: this line goes one much longer so for the sake of brevity I omitted most of it, as before set it to the same JAVA_OPTIONS that were output by startWebLogic.cmd

call “C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc_oes.cmd”

Note: I am assuming your user domain is oes_domain, adjust it to suit your domain name & folder location.

  1. From a command line (Run As Administrator), execute the file OES_Service.cmd.
    1. This will create a windows service with the name “beasvc oes_domain_AdminServer”. You can change that name, it’s defined after “-svcname:” at the very end of the InstallSvc_oes.cmd file.
  2. Execute the following additional command to adjust the display name
    sc config “beasvc oes_domain_AdminServer” DisplayName= “Weblogic OES Domain”

    Note: The space after the equal sign was intentional, and no space before, but you can use any actual display name you like

  3. Open up the Services console (through Administrative Tools)
  4. Find the service labelled “Weblogic OES Domain” and edit its properties as follows:
    1. Verify the Startup Type is “Automatic (Delayed Start)”
    2. Change the “Log On As” to another account (optional)
    3. Note: if you are using LocalSystem then you may be able to avoid the Delayed Start, in the environment I was working on this addressed an issue we had authenticating the log on account. An alternative to delayed start could be to define dependencies on TCP/IP & AFD (Ancillary Function Driver for Winsock)
  5. Apply the changes.
  6. Try to start the service.
    1. This may time out. By default Windows Services will time out after 30 seconds, so there could be an issue with the service taking a long time to start and tricking Windows into thinking its failed. Optionally adjust that time out value if you want:
      1. Open up RegEdit to adjust that timeout value
      2. Find the section: HKLM\ System\ CurrentControlSet\ Control
    2. Create a new DWORD value in this section of the hive:
      1. Name: ServicesPipeTimeout
      2. Value: 30000
  7. If you encounter other issues starting the services be aware the following syntax can help in troubleshooting it:
    1. Editing the batch files installSvc_oes and its manual counterpart startWebLogic with @echo and @rem can help extract variables for comparison.
    2. The service control utility from a command prompt provides several useful commands:
      sc start “beasvc oes_domain_AdminServer”
      sc stop “beasvc oes_domain_AdminServer”
      sc queryex “beasvc oes_domain_AdminServer”
      sc delete “beasvc oes_domain_AdminServer”
    3. You can start the beasvc utility in debug mode using this command:
      1. C:\Oracle\Middleware\wlserver_10.3.6\server\bin\beasvc –debug “beasvc oes_domain_AdminServer”
      2. This will start up the service and let you see the messages.
  8. You can also log in to the weblogic console to see if everything is working correctly:
    1. http://localhost:7001/console (this assumes oes is installed on the default port 7001)



This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.