Friday, May 27, 2011

How to add/modify BPEL /B2B/Mediator (component) properties – Where it gets stored?


In 11g first release there were properties which could be modified by navigating to $DOMAIN_HOME/soa_domain/config/soa-infra/configuration/ folder. All the config files related to different components used to be present in this folder.
But from subsequent releases the component properties were given an MBean interface for modifying the values. These values get directly updated in the MDS. This blog explains how to modify the values and where in turn it gets stored.
Properties for B2B, BPEL, Mediator, SOA-INFRA, Business rules, Adapter, EDN, workflow can be updated using the Mbeans. I will be taking the example of BPEL properties to show the way.
There are 2 ways of navigating to the properties via MBean.
1.    Soa-infra > Administration >  System MBean Browser



Application Defined MBeans >oracle.as.soainfra.config > Server :soa_server1
>B2BConfig >b2b
>BPELConfig >bpel



2.    Soa-infra > SOA Administration >BPEL Properties


Both the links will lead you to same MBean properties page.


Once you update the value, it gets directly updated in MDS. You can directly go and check in MDS.
Create a MDS connection.
The property files are available in
MDS  -- > soa > configuration >default > bpel –config.xml
                                                >b2b-config.xml
> soa-infra-config.xml
This will help you in verifying whether the values are updated properly.                                         

Wednesday, May 25, 2011

Adding custom jars/classes to Weblogic server -how it works


 One of the queries I got was on how to add custom jars to the weblogic server. This is described in detail in Oracle documentation. I will be just explaining on how it works.
          As you know a domain is a set of WebLogic servers with a central administration point (the Admin Server) and a central configuration repository (config. xml). A managed server is a WebLogic server instance running in a single JVM on a single machine with a targeted set of applications. If you go through the config.xml you will find a list of libraries that need to be loaded and added to the class path. One of them is the oracle extension library named oracle.soa.ext_11.1.1.

Code snippet - Entries from Config.xml

<library>
    <target>AdminServer,soa_server1</target>
    <source-path>D:/Oracle/Middleware/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/oracle.soa.ext.jar</source-path>
    <deployment-order>307</deployment-order>
    <security-dd-model>DDOnly</security-dd-model>
    <staging-mode>nostage</staging-mode>
  </library>

This entry is the handle Weblogic uses to load the custom jars.
How to add custom jars to weblogic domains is described in detail here

Main steps are

  1. Copy the jar files to this directory or its subdirectory.
To add custom jars :
 You can add custom classes and JAR files to an SOA composite application. A SOA extension library for adding extension classes and JARs to an SOA composite application is available in the $ORACLE_HOME/soa/modules/oracle.soa.ext_11.1.1 directory. For Oracle JDeveloper, custom classes and JARs are added to the application_name/project/sca-inf/lib directory.
To add custom classes:
Copy the classes to the classes directory. If the classes are used in bpelx:exec, you must also add the JARs in bpelcClasspath in bpel-config.xml. The bpel-config.xml is stored in soa/  folder in MDS.
  
  1. Run "ant".
  2. Restart Oracle WebLogic Server.
 
How it works ??
Go to $ORACLE_HOME/soa/modules/oracle.soa.ext_11.1.1 directory.
Open the oracle.soa.ext.jar.
The Existing MANIFEST file will look like below.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.0-b13 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.3.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: classes/

To see how it works I created a folder ext and added the jar - geo.soa.ext.jar to ext.
Ran the build file. It re-created the jar with new Manifest file.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 16.0-b13 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.3.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: ext/geo.soa.ext.jar classes


Restart the server. Observe the logs.


If you see the  oracle.soa.bpel.engine.compiler sets LibClasspath

Log Snippet
[soa_server1] [NOTIFICATION] [] [oracle.soa.bpel.engine.compiler] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@3b5c934] [userId: <anonymous>] [ecid: 0000J0Bx98BCgoK_MTk3ye1DpW4f000000,1:20517] [APP: soa-infra] [dcid: 437f5d69399c9ba4:-4506c58d:1300bf5c396:-7ffd-000000000000000e] LibClasspath=D:\Oracle\MIDDLE~1\ORACLE~1\modules\commonj.sdo_2.1.0.jar;D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;D:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.xdk_11.1.0\xmlparserv2.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\ext/geo.soa.ext.jar;D:\Oracle\Middleware\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\classes;D:\Oracle\MIDDLE~1\ORACLE~1\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar


The custom jars/classes are loaded at server startup so that the jars are available during runtime. Thanks to Siva for his inputs.

Monday, May 16, 2011

Significance of adf-config.xml in SOA composite


From a SOA development perspective adf-config.xml file is a configuration file which helps you in storing MDS related connection details. In case your project has references to any artifacts stored in MDS, the adf-config file will help you in connecting to, validating the artifact from MDS using the MDS store connection details provided in adf-config.xml.
I am listing few points below based on my experiences with adf-config.xml.
  1. During deployment, the entries inside the adf-config.xml are accessed to retrieve MDS connection details and connect to the MDS store for validating the artifacts before compilation of the composite.
  2. Further to deployment, adf-config.xml need to exist in the composite classes folder but   contents will not be used.  
  3. During loading of composites after bouncing the server any reference to oramds in composite files will look for the adf-config.xml in classes folder, even though the contents are not used.
  4. After deployment soa-infra will be referring to the mds-soa datasource for validation and loading the artifacts during server startup.  The soainfra app will use its own adf-config.xml which just happens to have a single partition accessed through jdbc/mds/MDS_LocalTxDataSource. The partition is configured in Metadata repositories. When you run RCU the MDS repositories are created and repositories get registered in the EM. In case you want to configure new partitions for MDS or change DB –based to file based, those configurations can be done in Weblogic Domain > domain >Metadata Repositories


Thats it :)