Sunday, September 19, 2010

How to use SOA -MDS for shared object

A lot has been already discussed about this by Clemens' and Biemond's blogs

In this exercise i am basically using the same concept as given in these links.

I will use the code provided by Clemens to store my fault policies in MDS and will see how does it work.

I will be using the same code sample that i have used for fault handling

you can download the fault handling project and we will do some modification in that and see how will it work when fault policies are stored in SOA-MDS.


I have used the binaries file provided by Clemens and have changed it for my application.

you might have to request to get the files


NOw down this binary file and import the .jpr file in to your jdeveloper.


Its structure should look like this




NOw as you can see that i have removed the fault-policies.xml and fault-bindings.xml from the bpel fault process.


Now the next important thing is to change the values in your build.properties file.

First is

oracle.home=D:\\oracle\\Middleware\\Oracle_SOA1

oracle.common.home=D:\\oracle\\Middleware\\oracle_common

Oracle.home will be the location where in you have installed SOA

oracle.common.home is the location of your BEA_HOME\oracle_common


admin.server.host=localhost
admin.server.port=7001


server host is my local host

server port is 7001 in my case

server.domain.name=soa_server1


it is the name of the domain that you have created during installation.

managed.server.host=localhost
managed.server.port=8001

foreign.mds.type=db


managed server is also local host for me and port is 8001 ,i am using db as MDS type that is my data will be stored in SOA_MDS dehydration

Finally


mds.db.userid=DEV_MDS
mds.db.password=welcome1
mds.db.jdbc-url=jdbc:oracle:thin:@localhost:1521:orcl

You have to provide the user for your MDS by default it is DEV_MDS

ONe these changes have been done you can just select the build.xml and run it to insert the data into MDS


The binary code that i am using to test or insert data in to mds is the one provided by Clemens and i am not really sure how does it internally work as i have very less knowledge in ant scripting.




It will ask for the password of the server



Provide the password and it will import the data in to the MDS

you will find the following output in the jdev ant query


Apache Ant version 1.7.0 compiled on December 13 2006
Could not load property file D:\common-binaries-mds\bin\build.properties: D:\common-binaries-mds\bin\build.properties (The system cannot find the path specified)
Buildfile: D:\common-binaries-mds\bin\build.xml
Detected Java version: 1.6 in: D:\jdev11g\jdk160_14_R27.6.5-32\jre
Detected OS: Windows XP
parsing buildfile D:\common-binaries-mds\bin\build.xml with URI = file:/D:/common-binaries-mds/bin/build.xml
Project base dir set to: D:\common-binaries-mds\bin
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[property] Loading D:\common-binaries-mds\bin\build.properties
Override ignored for property "oracle.home"
[echo] Ant: Apache Ant version 1.7.0 compiled on December 13 2006 Java: 1.6
[available] Found: D:\jdev11g\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar
[property] Loading Environment env.
Property "env.JAVA_HOME" has not been set
[echo] Using mds-type : db
[available] Found: D:\oracle\Middleware\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar
Build sequence for target(s) `importCommonServiceArtifactsIntoMds' is [init, ConfigMDSStore, importCommonServiceArtifactsIntoMds]
Complete build sequence is [init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForServerFileStore, createMDSConfigForFileStore, createMDSConfigForDB, deleteCommonServiceArtifactsFromMds, ]

init:
[echo] SOA Suite 11g version:
[java] running com.collaxa.cube.util.BuildInfo with default permissions (exit forbidden)
[java] Running in same VM Executing 'com.collaxa.cube.util.BuildInfo'
The ' characters around the executable and arguments are
not part of the command.
[java]
[java] *****************************************************************************
[java] Oracle SOA Server version 11.1.1.2.0
[java] Build: 0
[java] Build time: Tue Nov 03 13:48:58 PST 2009
[java] Build type: release
[java] Source tag: PCBPEL_11.1.1.2.0_GENERIC_091103.1205.1216
[java]
[echo] soa infra mgmt home: D:\oracle\Middleware\oracle_common
[echo] oracle home: D:\jdev11g\jdeveloper\
[echo] oracle common home: D:\oracle\Middleware\oracle_common
[mkdir] Skipping D:\common-binaries-mds\bin\util\classes because it already exists.
[javac] com\otn\sample\fod\soa\util\GetCurrentTimeStampHelper.java omitted as D:\common-binaries-mds\bin\util\classes\com\otn\sample\fod\soa\util\GetCurrentTimeStampHelper.class is up to date.
[javac] com\otn\sample\fod\soa\util\MdsDeleteTask.java omitted as D:\common-binaries-mds\bin\util\classes\com\otn\sample\fod\soa\util\MdsDeleteTask.class is up to date.
[javac] com\otn\sample\fod\soa\util\MdsImportTask.java omitted as D:\common-binaries-mds\bin\util\classes\com\otn\sample\fod\soa\util\MdsImportTask.class is up to date.

ConfigMDSStore:
Project base dir set to: D:\common-binaries-mds\bin
[antcall] calling target(s) [createMDSConfigForDB] in build file D:\common-binaries-mds\bin\build.xml
parsing buildfile D:\common-binaries-mds\bin\build.xml with URI = file:/D:/common-binaries-mds/bin/build.xml
Project base dir set to: D:\common-binaries-mds\bin
[property] Loading D:\common-binaries-mds\bin\build.properties
Override ignored for property "admin.server.port"
Override ignored for property "oracle.common.home"
Override ignored for property "server.domain.name"
Override ignored for property "foreign.mds.type"
Override ignored for property "oracle.home"
Override ignored for property "managed.server.host"
Override ignored for property "mds.db.password"
Override ignored for property "mds.db.userid"
Override ignored for property "managed.server.port"
Override ignored for property "mds.db.jdbc-url"
Override ignored for property "admin.server.host"
Override ignored for property "adf.config.uri"
[echo] Ant: Apache Ant version 1.7.0 compiled on December 13 2006 Java: 1.6
[available] Found: D:\jdev11g\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar
[property] Loading Environment env.
Override ignored for property "env.SystemDrive"
Override ignored for property "env.PERL5LIB"
Override ignored for property "env.windir"
Override ignored for property "env.PATHEXT"
Override ignored for property "env.USERDOMAIN"
Override ignored for property "env.PROCESSOR_IDENTIFIER"
Override ignored for property "env.SESSIONNAME"
Override ignored for property "env.PROCESSOR_LEVEL"
Override ignored for property "env.ComSpec"
Override ignored for property "env.PSModulePath"
Override ignored for property "env.OS"
Override ignored for property "env.ProgramFiles"
Override ignored for property "env.HOMEDRIVE"
Override ignored for property "env.DEFLOGDIR"
Override ignored for property "env.HOMEPATH"
Override ignored for property "env.Path"
Override ignored for property "env.PROCESSOR_REVISION"
Override ignored for property "env.USERPROFILE"
Override ignored for property "env.TMP"
Override ignored for property "env.ALLUSERSPROFILE"
Override ignored for property "env.USERNAME"
Override ignored for property "env.LOGONSERVER"
Override ignored for property "env.PROMPT"
Override ignored for property "env.PROCESSOR_ARCHITECTURE"
Override ignored for property "env.CommonProgramFiles"
Override ignored for property "env.VSEDEFLOGDIR"
Override ignored for property "env.APPDATA"
Override ignored for property "env.TEMP"
Override ignored for property "env.NUMBER_OF_PROCESSORS"
Override ignored for property "env.SystemRoot"
Override ignored for property "env.FP_NO_HOST_CHECK"
Override ignored for property "env.COMPUTERNAME"
Property "env.JAVA_HOME" has not been set
[echo] Using mds-type : db
Override ignored for property "db.based"
[available] Found: D:\oracle\Middleware\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar
Override ignored for property "oracle.soa.mgmt.home"
[input] skipping input as property server.password has already been set.
Override ignored for property "wls.home"
Build sequence for target(s) `createMDSConfigForDB' is [createMDSConfigForDB]
Complete build sequence is [createMDSConfigForDB, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForServerFileStore, createMDSConfigForFileStore, deleteCommonServiceArtifactsFromMds, ]
[antcall] Entering D:\common-binaries-mds\bin\build.xml...
Build sequence for target(s) `createMDSConfigForDB' is [createMDSConfigForDB]
Complete build sequence is [createMDSConfigForDB, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForServerFileStore, createMDSConfigForFileStore, deleteCommonServiceArtifactsFromMds, ]

createMDSConfigForDB:
[echo] Creating ../.adf/META-INF/adf-config.xml for database backed MDS
[input] skipping input as property mds.db.password has already been set.
[copy] Copying 1 file to D:\common-binaries-mds\.adf\META-INF
[copy] Copying D:\common-binaries-mds\bin\templates\adf-config-db.seed to D:\common-binaries-mds\.adf\META-INF\adf-config.xml
[replace] Replacing in D:\common-binaries-mds\.adf\META-INF\adf-config.xml: @db.user@ --> DEV_MDS
[replace] Replacing in D:\common-binaries-mds\.adf\META-INF\adf-config.xml: @db.password@ --> welcome1
[replace] Replacing in D:\common-binaries-mds\.adf\META-INF\adf-config.xml: @db.connect.string@ --> jdbc:oracle:thin:@localhost:1521:orcl
[echo] Using jdbc:oracle:thin:@localhost:1521:orcl for db-based backing, with user DEV_MDS
[antcall] Exiting D:\common-binaries-mds\bin\build.xml.
Project base dir set to: D:\common-binaries-mds\bin
[antcall] calling target(s) [createMDSConfigForFileStore] in build file D:\common-binaries-mds\bin\build.xml
parsing buildfile D:\common-binaries-mds\bin\build.xml with URI = file:/D:/common-binaries-mds/bin/build.xml
Project base dir set to: D:\common-binaries-mds\bin
[property] Loading D:\common-binaries-mds\bin\build.properties
Override ignored for property "admin.server.port"
Override ignored for property "oracle.common.home"
Override ignored for property "server.domain.name"
Override ignored for property "foreign.mds.type"
Override ignored for property "oracle.home"
Override ignored for property "managed.server.host"
Override ignored for property "mds.db.password"
Override ignored for property "mds.db.userid"
Override ignored for property "managed.server.port"
Override ignored for property "mds.db.jdbc-url"
Override ignored for property "admin.server.host"
Override ignored for property "adf.config.uri"
[echo] Ant: Apache Ant version 1.7.0 compiled on December 13 2006 Java: 1.6
[available] Found: D:\jdev11g\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar
[property] Loading Environment env.
Override ignored for property "env.SystemDrive"
Override ignored for property "env.PERL5LIB"
Override ignored for property "env.windir"
Override ignored for property "env.PATHEXT"
Override ignored for property "env.USERDOMAIN"
Override ignored for property "env.PROCESSOR_IDENTIFIER"
Override ignored for property "env.SESSIONNAME"
Override ignored for property "env.PROCESSOR_LEVEL"
Override ignored for property "env.ComSpec"
Override ignored for property "env.PSModulePath"
Override ignored for property "env.OS"
Override ignored for property "env.ProgramFiles"
Override ignored for property "env.HOMEDRIVE"
Override ignored for property "env.DEFLOGDIR"
Override ignored for property "env.HOMEPATH"
Override ignored for property "env.Path"
Override ignored for property "env.PROCESSOR_REVISION"
Override ignored for property "env.USERPROFILE"
Override ignored for property "env.TMP"
Override ignored for property "env.ALLUSERSPROFILE"
Override ignored for property "env.USERNAME"
Override ignored for property "env.LOGONSERVER"
Override ignored for property "env.PROMPT"
Override ignored for property "env.PROCESSOR_ARCHITECTURE"
Override ignored for property "env.CommonProgramFiles"
Override ignored for property "env.VSEDEFLOGDIR"
Override ignored for property "env.APPDATA"
Override ignored for property "env.TEMP"
Override ignored for property "env.NUMBER_OF_PROCESSORS"
Override ignored for property "env.SystemRoot"
Override ignored for property "env.FP_NO_HOST_CHECK"
Override ignored for property "env.COMPUTERNAME"
Property "env.JAVA_HOME" has not been set
[echo] Using mds-type : db
Override ignored for property "db.based"
[available] Found: D:\oracle\Middleware\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar
Override ignored for property "oracle.soa.mgmt.home"
[input] skipping input as property server.password has already been set.
Override ignored for property "wls.home"
Build sequence for target(s) `createMDSConfigForFileStore' is [createMDSConfigForFileStore]
Complete build sequence is [createMDSConfigForFileStore, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForServerFileStore, createMDSConfigForDB, deleteCommonServiceArtifactsFromMds, ]
[antcall] Entering D:\common-binaries-mds\bin\build.xml...
Build sequence for target(s) `createMDSConfigForFileStore' is [createMDSConfigForFileStore]
Complete build sequence is [createMDSConfigForFileStore, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForServerFileStore, createMDSConfigForDB, deleteCommonServiceArtifactsFromMds, ]

createMDSConfigForFileStore:
Skipped because property 'file.based' not set.
[antcall] Exiting D:\common-binaries-mds\bin\build.xml.
Project base dir set to: D:\common-binaries-mds\bin
[antcall] calling target(s) [createMDSConfigForServerFileStore] in build file D:\common-binaries-mds\bin\build.xml
parsing buildfile D:\9948771\common-binaries-mds\bin\build.xml with URI = file:/D:/common-binaries-mds/bin/build.xml
Project base dir set to: D:\common-binaries-mds\bin
[property] Loading D:\common-binaries-mds\bin\build.properties
Override ignored for property "admin.server.port"
Override ignored for property "oracle.common.home"
Override ignored for property "server.domain.name"
Override ignored for property "foreign.mds.type"
Override ignored for property "oracle.home"
Override ignored for property "managed.server.host"
Override ignored for property "mds.db.password"
Override ignored for property "mds.db.userid"
Override ignored for property "managed.server.port"
Override ignored for property "mds.db.jdbc-url"
Override ignored for property "admin.server.host"
Override ignored for property "adf.config.uri"
[echo] Ant: Apache Ant version 1.7.0 compiled on December 13 2006 Java: 1.6
[available] Found: D:\jdev11g\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar
[property] Loading Environment env.
Override ignored for property "env.SystemDrive"
Override ignored for property "env.PERL5LIB"
Override ignored for property "env.windir"
Override ignored for property "env.PATHEXT"
Override ignored for property "env.USERDOMAIN"
Override ignored for property "env.PROCESSOR_IDENTIFIER"
Override ignored for property "env.SESSIONNAME"
Override ignored for property "env.PROCESSOR_LEVEL"
Override ignored for property "env.ComSpec"
Override ignored for property "env.PSModulePath"
Override ignored for property "env.OS"
Override ignored for property "env.ProgramFiles"
Override ignored for property "env.HOMEDRIVE"
Override ignored for property "env.DEFLOGDIR"
Override ignored for property "env.HOMEPATH"
Override ignored for property "env.Path"
Override ignored for property "env.PROCESSOR_REVISION"
Override ignored for property "env.USERPROFILE"
Override ignored for property "env.TMP"
Override ignored for property "env.ALLUSERSPROFILE"
Override ignored for property "env.USERNAME"
Override ignored for property "env.LOGONSERVER"
Override ignored for property "env.PROMPT"
Override ignored for property "env.PROCESSOR_ARCHITECTURE"
Override ignored for property "env.CommonProgramFiles"
Override ignored for property "env.VSEDEFLOGDIR"
Override ignored for property "env.APPDATA"
Override ignored for property "env.TEMP"
Override ignored for property "env.NUMBER_OF_PROCESSORS"
Override ignored for property "env.SystemRoot"
Override ignored for property "env.FP_NO_HOST_CHECK"
Override ignored for property "env.COMPUTERNAME"
Property "env.JAVA_HOME" has not been set
[echo] Using mds-type : db
Override ignored for property "db.based"
[available] Found: D:\oracle\Middleware\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar
Override ignored for property "oracle.soa.mgmt.home"
[input] skipping input as property server.password has already been set.
Override ignored for property "wls.home"
Build sequence for target(s) `createMDSConfigForServerFileStore' is [createMDSConfigForServerFileStore]
Complete build sequence is [createMDSConfigForServerFileStore, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForFileStore, createMDSConfigForDB, deleteCommonServiceArtifactsFromMds, ]
[antcall] Entering D:\common-binaries-mds\bin\build.xml...
Build sequence for target(s) `createMDSConfigForServerFileStore' is [createMDSConfigForServerFileStore]
Complete build sequence is [createMDSConfigForServerFileStore, init, ConfigMDSStore, importCommonServiceArtifactsIntoMds, createMDSConfigForFileStore, createMDSConfigForDB, deleteCommonServiceArtifactsFromMds, ]

createMDSConfigForServerFileStore:
Skipped because property 'server.file.based' not set.
[antcall] Exiting D:\common-binaries-mds\bin\build.xml.

importCommonServiceArtifactsIntoMds:
[java] Executing 'D:\jdev11g\jdk160_14_R27.6.5-32\jre\bin\java.exe' with arguments:
'-Doracle.home=D:\jdev11g\jdeveloper\'
'-classpath'
'D:\common-binaries-mds\bin\util\classes;D:\oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdslcm.jar;D:\oracle\Middleware\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;D:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;D:\oracle\Middleware\oracle_common\modules\oracle.xdk_11.1.0\xml.jar;D:\oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adf-share-support.jar;D:\oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-ca.jar;D:\oracle\Middleware\oracle_common\modules\oracle.adf.share.ca_11.1.1\adf-share-base.jar;D:\oracle\Middleware\oracle_common\modules\oracle.adf.share_11.1.1\adflogginghandler.jar;D:\oracle\Middleware\oracle_common\modules\oracle.idm_11.1.1\identitystore.jar;D:\oracle\Middleware\oracle_common\modules\oracle.javacache_11.1.1\cache.jar;D:\jdev11g\modules\javax.xml.bind_2.1.1.jar;D:\jdev11g\modules\javax.activation_1.1.0.0_1-1.jar;D:\jdev11g\modules\com.bea.core.apache.xercesImpl_2.8.1.jar;D:\oracle\Middleware\oracle_common\modules\oracle.dms_11.1.1\dms.jar;D:\oracle\Middleware\oracle_common\modules\oracle.odl_11.1.1\ojdl.jar;D:\oracle\Middleware\oracle_common\modules\oracle.xmlef_11.1.1\xmlef.jar;D:\oracle\Middleware\oracle_common\modules\oracle.bali.share_11.1.1\share.jar;D:\oracle\Middleware\oracle_common\modules\oracle.ucp_11.1.0.jar;D:\jdev11g\wlserver_10.3\server\ext\jdbc\oracle\11g\ojdbc6.jar;D:\jdev11g\modules\org.apache.ant_1.7.0\lib\ant.jar;D:\jdev11g\wlserver_10.3\server\lib\weblogic.jar;D:\oracle\Middleware\oracle_common\modules\oracle.jrf_11.1.1\jrf.jar;D:\oracle\Middleware\oracle_common\modules\oracle.webservices_11.1.1\wsclient.jar;D:\jdev11g\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;D:\oracle\Middleware\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;D:\oracle\Middleware\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;D:\jdev11g\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle-soa-client-api.jar'
'com.otn.sample.fod.soa.util.MdsImportTask'
'../.adf/META-INF/adf-config.xml'
'mstore-usage_1'
'apps'
'./MySeed'

The ' characters around the executable and arguments are
not part of the command.
[java] Starting local filesystem import into mds ..
[java] Got target mds-instance: mstore-usage_1 from D:\common-binaries-mds\bin\..\.adf\META-INF\adf-config.xml
[java] Creating source mds connection to ./MySeed/apps
[java] --> D:\common-binaries-mds\bin\.\MySeed
[java] Local item: /apps/common/fault-bindings.xml
[java] Local item: /apps/common/fault-policies.xml
[java] Now transferring ..
[java] Sep 22, 2010 9:46:26 PM oracle.mds
[java] NOTIFICATION: import operation started.
[java] Transferred size = 2
[java] Sep 22, 2010 9:46:26 PM oracle.mds
[java] NOTIFICATION: import is completed. Total number of documents successfully processed : 2, total number of documents failed : 0.
[java] Transferred - /apps/common/fault-bindings.xml
[java] Transferred - /apps/common/fault-policies.xml

BUILD SUCCESSFUL
Total time: 7 seconds


ONce it is completed your data are inserted in to the MDS store.

YOu might get some compilation error because of the version of jar files used so you just have to replace the version with the one which you have in your environment and then you should be able to run it successfully.

Now if you can see the folder structure of the binary file i have copied the fault policy file within Myseed-->apps-->common folder.

IT has to be apps and then you can create your own folder structure otherwise there will be some permission issue.


now we will open the composite.xml of our faulted process and use the following code in our composite
<property name="oracle.composite.faultPolicyFile">oramds:/apps/common/fault-policies.xml</property>
<property name="oracle.composite.faultBindingFile">oramds:/apps/common/fault-bindings.xml</property>


instead of

<property name="oracle.composite.faultPolicyFile">fault-policies.xml</property>
<property name="oracle.composite.faultBindingFile">fault-bindings.xml</property>

Here now you can consider one pattern over here

we have the entry as oramds:/apps/common/fault-bindings.xml

as you can see we have the same structure entry as the folder structure that i have created in binary file.

NOw save this and redeploy your project.

Now test this project ,i have used the same fault policy file so it should go to manual recovery.

I tested this and i got the expected result



Let me know if you have issues in the same.

No comments: