In the original post on EPM compact deployments I left two open questions and this week it is time for the second question to be covered off which only relates to windows OS deployments.
Once a compact mode has completed successfully a batch script named startEPMSystem.bat is generated to start up the WebLogic managed server, no windows service is created like the other WebLogic deployed products so to make life a little bit easier I set myself a task to create a windows service that will start up the EPM managed server.
Now I know it is probably possible to try and use the Weblogic install service utility but I didn’t have much success with it and I also I wanted the service to function like the other products in the stack so here are the steps I carried out to set up the service.
In a standard deployment once the Weblogic web applications have been started and if you look in task manager you will see a process for each managed server, each process has the same description as in fact they are all the same executable just with a different name.
Each of these executables are called when the service is started and they all reside in <MIDDLEWARE_HOME>\user_projects\domains\<domain name>\bin
The executables originate from <MIDDLEWARE_HOME>\EPMSystem11R1\common\utilities\JavaService, there is a 32bit and 64bit version of the executable.
When a Weblogic managed service is deployed it copies the file from the above directory into <MIDDLEWARE_HOME>\user_projects\domains\<domain name>\bin and renames it depending on which web application is being deployed.
I copied HyslJavaServiceAMD64.exe into <MIDDLEWARE_HOME>\user_projects\domains\epmsystem1\bin and renamed it to EPMSystem.exe
Usually the default deployment domain name is EPMSystem but in my compact deployment I called it epmsystem1.
If you take a look at any of the start up commands for the windows services you will see/ServiceName= and /RegKey=
these define the registry keys used and are called upon when the windows service is started.
The keys are all stored under HKLM\SOFTWARE\Hyperion Solutions and contain important variables and various paths to pass into the WebLogic managed server for it to be able to function correctly.
For the windows service I am creating I would need to create a new registry key for the EPM Managed server.
When a compact deployment is run it creates a file called setManagedParamsEPMserver.bat in <MIDDLEWARE_HOME>\user_projects\domains\<domain name>\bin
This file contains all the necessary information for the registry key so the next step was to transfer this information into a .reg file.
Instead of creating the file from scratch I did use a registry key that had already been created from another EPM 18.104.22.168 instance, I used the foundation services registry key as a starting point and these keys can be found in <MIDDLEWARE_HOME>\user_projects\<instance_name>\bin\deploymentScripts\installServiceScripts
The registry file needed a clean up as some of the options are repeated two or three times.
Windows Registry Editor Version 5.00This is the registry file I came up with, it was saved as a .reg file and executing it updated the registry with the information. If you intend on using it then you will need to update the middle home directory and maybe the domain name if you use anything other than epmsystem1 as the usual domain name in an EPM deployment is EPMSystem.
One of the nice features of using this method is you get the option of generating logs like the other EPM products that use a windows service using the SysErrFile and SysOutFile options
The final step is to generate the windows service and this can be done by using the command line utility SC.
The command line used was
SC create “EPM Managed Server” binpath= “E:\Oracle\Middleware\user_projects\domains\epmsystem1\bin\EPMSystem.exe” /StartClass=weblogic.Server /ServiceName=EPM11 /RegKey=EPMSystem0
When I started up the service I did notice some errors in the log relating a performance pack which stressed that performance could be degraded, this didn’t stop the managed server from starting up and working but it needed fixing, I went back to starting up the managed server by the standard batch file and the same error was being generated so it wasn’t down to the registry file I had created.
To fix this issue I just added an extra path to the –Djava.library.path option in the registry
The path added that was added was <MIDDLEWARE_HOME>\wlserver_10.3\server\native\win\x64
I did spot one more issue which only occurred if I set the JVM maximum size over 1.5GB then an out of memory error was generated in the log and the web application would terminate.
The issue seems to be common when using jrocket as the JVM, if the maximum size was set over 4GB then the error goes away but I found it was possible to also get around the issue without having to set the maximum size to 4GB by adding an extra option in the registry which is passed into the managed server.
An extra JVMOption was added with a value of –XXcompressedRefs:size=32GB (if you want to read in-depth details on why this option may have to be used then have a read here)
As an extra option was added the JVMOptionCount in the registry has to be incremented by 1.
I have not seen any other issues and the managed server is running well when started from a service.