Pages - Menu

Showing posts with label Windows Service. Show all posts
Showing posts with label Windows Service. Show all posts

How to install the Admin Server of a SOA domain as a Windows Service?

Wednesday, July 24, 2013


To install the Admin Server as a Windows Service, the following steps need to be done.  However not all of these steps are required if a SOA domain is already running with a Database.

1) Install Oracle XE under C:\Oracle\oraclexe
2) Alter the processes amount using sql plus with the following SQL:


        sqlplus / as sysdba
        alter system set processes = 200 scope=spfile;
        commit;


NOTE: For Linux the environment variable RCU_JDBC_TRIM_BLOCKS needs to be set to true.

       RCU_JDBC_TRIM_BLOCKS=true
       Export RCU_JDBC_TRIM_BLOCKS
 


3) Run RCU and select SOA infrastructure under SOA & BPM infrastructure. (User Messaging System auto selected)
 
4) Install WLS 10.3.3 under C:\Oracle\Middleware


5) Install SOA 11.1.1.2 under C:\Oracle\Middleware\Oracle_SOA1


6) Install SOA 11.1.1.3 under C:\Oracle\Middleware\Oracle_SOA1 (To avoid potential issues with the patching utility)


7) Create a SOA Domain with successful testing of the Database schema


8) Modify the nodemanager.properties file, located under <Middleware_home>\<WL_Home>\common\nodemanager folder and set the following values to the properties:

CrashRecoveryEnabled=true
StartScriptEnabled=true

9) Install NodeManager as a Windows Service.


Optional: At this point, to check the the proper SOA deployments status we can start the admin server through the scripts, start node manager through the windows service, and start the soa_server1 through the administration console.
Which is actually a command to the node manager to start the server. After the soa_server1 is in running mode, go to deployments and you can note that the deployments are healthy.
You should stop the servers before continuing. 
 


10) Create the following script to install the Admin Server as a Windows Service (change the values, and set them as your's environment, I had to use Jrockit for SOA, thus JAVA_VM is -jrockit, 
Sun's JAVA_VM is -client, for Windows 64 bit and Sun JDK JAVA_VM is -server  


Note : If you are trying to Start a Weblogic Admin Server or Managed Server via a Service on 64bit Windows Fails with "Unable to Find a JVM".Please refer below link.

http://learn-weblogic.blogspot.in/2013/07/trying-to-start-weblogic-admin-server.html
@echo off
        SETLOCAL
        set DOMAIN_NAME=soa_domain
        set USERDOMAIN_HOME=C:\Oracle\Middleware\user_projects\domains\soa_domain
        set SERVER_NAME=AdminServer
        set PRODUCTION_MODE=false
        set WLS_USER=weblogic
        set WLS_PW=weblogic1
        set JAVA_OPTIONS=-Dweblogic.Stdout="C:\Oracle\Middleware\user_projects\domains\SOA\Admin_stdout.txt" -Dweblogic.Stderr="C:\Oracle\Middleware\user_projects\domains\SOA\Admin_stderr.txt"
        set JAVA_VM=-jrockit
        set MEM_ARGS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m
        set MAX_CONNECT_RETRIES=3
        set HOST=localhost
        set PORT=7001
        call "C:\Oracle\Middleware\wlserver_10.3\server\bin\installSvc.cmd"
        ENDLOCAL


11) Edit the installSvc.cmd script file located in <wl_home>\server\bin
The script will now use the right script to set the environment variables: setDomainEnv.cmd instead of the default commEnv.cmd.


        ...
        @echo off
        SETLOCAL
      
        set WL_HOME=D:\Oracle\Middleware11gR1PS3\wlserver_10.3
        rem call "%WL_HOME%\common\bin\commEnv.cmd"
        call "%USERDOMAIN_HOME%\bin\setDomainEnv.cmd"
      
        @rem Check that the WebLogic classes are where we expect them to be
        :checkWLS
        ...


12) At this point we need to run the script file we created to install the admin server as a windows service. This script will not run successfully but fail with "oracle.fabric.common.classloaderurl.handler" is not recognized as an internal or external command, operable program or batch file.

However it's important for the script to fail in order to obtain some key information, the CMDLINE variable value. The script needs to be invoked using a command prompt window and not by double clicking on the script file. 

Why is this?
 
In the new version of the setDomainEnv.cmd, the property PROTOCOL_HANDLERS is set to five protocol handlers concatenated together by a pipe ( | ): oracle.mds.net.protocol"|"oracle.fabric.common.classloaderurl.handler"|"oracle.fabric.common.uddiurl.handler"|"oracle.bpm.io.fs.protocol. This property is assigned to JAVA_OPTIONS 
which is used again in the installSvc.cmd script 
when setting the CMDLINE property. 



       set CMDLINE="-client -Xms512m -Xmx1024m -XX:PermSize=128m              
        -XX:MaxPermSize=512m -Dweblogic.Stdout="D:\Oracle ".....

       -Djava.protocol.handler.pkgs=oracle.mds.net.protocol" |            

       "oracle.fabric.common.classloaderurl.handler" |  
       "oracle.fabric.common.uddiurl.handler" | "oracle.bpm.io.fs.protocol

       .... weblogic.Server"


 As you can see there are additional spaces added between the protocol handler packages now. This causes the problem. As the previous version only assigned one protocol handler package this problem never occurred until now.

To work around this issue the value of CMDLINE needs to be changed from:

 

       set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath   
       \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME%                             
       -Dweblogic.management.username=%WLS_USER% 
       -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% 
       -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

 To the complete CMDLINE value from the previous run, which failed (remember to remove the spaces and note the strong> assignation).


       set CMDLINE="-jrockit -Xms512m -Xmx1024m -XX:PermSize=128m 
       -XX:MaxPermSize=512m -Dweblogic.Stdout="D:\Oracle ......    -Djava.protocol.handler.pkgs=strong>oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol
       .... weblogic.Server"


 At this point the service creation should work.

13) The Node Manager is now running as a windows service and the admin server can be started from the windows services as well. 
Once up and running the administration console can be used to start soa_server1 and the SOA applications can be accessed.




Note 1: As a good practice, always check the registry of the Windows Service installation.
Sometimes the workaround we did to install the service (strong>dms...)
Will break the soa-infra application to work (core of SOA)

So check the registry in:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\beasvc <DomainName>_AdminServer\Parameters]

Edit CmdLine. And change the following parameter from the line: 



-Djava.protocol.handler.pkgs=strong>oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol

To:

-Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol
 

Blogger news

Blogroll

Most Reading