Wednesday, November 23, 2011

Business Rule issue while migrating from Oracle SOA Suite 10g to Oracle SOA Suite 11g - Compilation errors with rule facts classes having long qualified package name.

Business Rule issue while migrating from Oracle SOA Suite 10g to Oracle SOA Suite 11g - Compilation errors with rule facts classes having long qualified package name.

If we had used the long qualified package name with rule facts classes (mainly with XML facts)e.g. “com.xxxxxxx.ns._2007._01._25.gcap.eai.ordermanagement” in 10g Business rule ,we will be receiving the below error during the compilation of the composite with the migrated rule in 11g.



[scac] error: location {/ns:composite/ns:import[@location='file:/D:/Albin/EAI/DevCodeBase/11g_Migration/CRM_EAI_code_deploy/code/OrderRequestRule/OrderRequestRule/OrderLineRequestDictionary141008_DecisionService_1.wsdl']}: Load of wsdl "OrderLineRequestDictionary141008_DecisionService_1.wsdl with Message part element undefined in wsdl [file:/D:/Albin/EAI/DevCodeBase/11g_Migration/CRM_EAI_code_deploy/code/OrderRequestRule/OrderRequestRule/OrderLineRequestDictionary141008_DecisionService_1.wsdl] part name = payload type = {http://xmlns.oracle.com/OrderLineRequestDictionary141008/OrderLineRequestDictionary141008_DecisionService_1}callFunctionStatelessDecision" failed
[scac] error: location {OrderLineRequestDictionary141008}: Rule Dictionary OrderLineRequestDictionary141008 is invalid.
[scac] error: location {OrderLineRequestDictionary141008}: Function OrderLineRequestDictionary141008.Version1_1.OrderLineRequestDictionary141008.OrderLineRequestDictionary141008_DecisionService_1 does not exist in rule dictionary

The rule facts need to be recreated with the shorter package name to overcome this compilation error.

The below are the steps to recreate the rule facts from XSD:

1. Remove all the XML facts - Open the rule dictionary and remove all the facts available.




Sunday, November 20, 2011

Migrating the WEBDAV Business Rule Repository from Oracle SOA Suite 10g to Oracle SOA Suite 11g format and exposing the rules as a webservice.


Migrating the WEBDAV Business Rule Repository from Oracle SOA Suite 10g to Oracle SOA Suite 11g format and exposing the rules as a webservice.

If we had used the Business Rule in 10g the same should be migrated to 11g.The below are the steps to migrate the sample webdav rule repository from 10g to 11g and to expose the rule dictionary as a service.
  1. Create a folder Rules with child folders “jaxboutput” and “xsd”.
  1. Copy the xsd files used in 10g to build the Input/output of rule to xsd folder.
  1. Crete a java file “RuleMigrator.java” with the below contents.
import java.io.PrintWriter;
import java.util.ArrayList;
import oracle.rules.tools.migrator.MigrateRuleRepository;
public class RuleMigrator {
public RuleMigrator() {
super();
}
public static void migrateRule() throws Exception{
String parent_output_dir=System.getenv("rule.output.path");
MigrateRuleRepository conv = new MigrateRuleRepository();
// Set the output buffer
conv.setOutLog(new PrintWriter(System.out));
// Set input properties (SDK format)
conv.setOriginLocation(System.getenv("rule.repository.location"));
conv.setXSDOutputDir(parent_output_dir+"\\jaxboutput");
conv.setOriginType(MigrateRuleRepository.WEBDAV_REPO);
conv.setOriginUserid(System.getenv("rule.repository.username"));
conv.setOriginPassword(System.getenv("rule.repository.password"));
conv.setOriginDictionaryName(MigrateRuleRepository.MIGRATE_ALL);
conv.setOriginVersionName(MigrateRuleRepository.MIGRATE_ALL);
conv.setLogWithStackTrace(true);
conv.setXSDLocation(parent_output_dir+"\\xsd");
// Set output properties
conv.setDestinationLocation(current_dir+"\\Rules");
System.out.println("Before calling migrate");
conv.migrate();
String results = conv.getTotalStats();
System.out.print(results);
}
public static void main(String[] args) {
try
{
migrateRule();
}catch(Exception e) {
e.printStackTrace();
}
}
}



Wednesday, November 16, 2011

Migrating the Metadata from Oracle SOA Suite 10g to 11g and sharing the common artifacts to MDS Repository.


Migrating the Metadata from Oracle  SOA Suite 10g to 11g and sharing the common artifacts to Repository:

If we use the Domain Value Maps (DVMs) or Cross References in Oracle BPEL Process Manager 10g or Oracle Enterprise Service Bus 10g project, the Xpath functions used to access the domain value maps or cross references will be upgraded automatically when the projects are upgraded in Oracle JDeveloper 11g.
However, a manual upgrade task has to be performed to upgrade the domain value maps and cross references that are saved in the Oracle Enterprise Service Bus repository. Also, if we use the common schemas or WSDLs in 10g project the same should be migrated to MDS repository; in 11g all the common artifacts will be stored in MDS repository.

There is a lot of information for the same topic but thought of sharing my experience.
Below are the steps for migrating the DVMs and XREFs to 11g and also to create the project that will have all the common artifacts like DVM, XREF, WSDL and SCHEMAs that can be stored to MDS repository.

Export the DVM and XREF metadata from 10g server: (Steps should be executed on 10 g server)

  1. Log on to your Oracle SOA Suite 10g server.
  2. cd $ORACLE_HOME/integration/esb/bin
  3. Set the environment - ./ esbsetenv.sh
  4. Run the export.sh script to export the entire ESB metadata - ./export.sh metadata10g.zip.
  5. Copy the metadata10g.zip file from $ORACLE_HOME\integration\esb\bin to the Oracle SOA 11g server.

Convert the ZIP file to an Oracle SOA Suite 11g archive file (Steps should be executed on 11g server) :

  1. Log on to your Oracle SOA 11g server
  2. Set your environment:
export DomainHome=<<Weblogic DomainHome>>
export OracleHome=<<OracleHome>>
cd $DomainHome/bin
. setDomainEnv.sh
  1. Execute the below comments to convert the 10g metadata to 11g format.
cd $OracleHome/bin
ant -f ant-sca-upgrade.xml upgrade-xrefdvm -Dsource=<<Path to metadata10g.zip>> -Dtarget= <<Target path>>
  1. Copy the archive sca_XrefDvmFiles10g_rev1.0.jar generated in target path to local machine.

Create the Metadata project:

  • Create a new Generic Application (e.g. MetaDataApp) in JDeveloper 11g.
  • Click “Next” and Give a Project Name e.g. Metadata.
  • From the Oracle JDeveloper 11g “File” menu, select “Import”, then “SOA Archive into SOA Project”. In the Import Composite Archive Dialog Box, click Browse and locate the sca_XrefDvmFiles10g_rev1.0.jar file that you created previously.
  • Make sure that the Project Name and Composite Name in the Create SOA Project from SOA Archive dialog box and Import Composite Archive Dialog Box have the same name.
  • Click Finish to create the new SOA project. The new project consists of an empty composite, along with the upgraded Xref and DVM files.
  • Crete new folders with the name Xref, dvm, faultpolicy, schemas and WSDL under SOAContent of the project folder based on the different type of artifacts needs to be stored in MDS.




Monday, November 14, 2011

Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g.


Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g:

Because of the container change from 10g to 11g, the web services developed in 10g has to be migrated to latest format.

The main step for the migration is changing the deployment descriptors created for OC4J to vendor specific descriptor format.


Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g:

1. Change the Web.xml (<Webservice Home>/public_html/WEB-INF) contents:-
Replace the below contents in the web.xml.
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns: xsi=http://www.w3.org/2001/XMLSchema-instance xsi: schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version="2.4">
With the following contents
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns: xsi=http://www.w3.org/2001/XMLSchema-instance xsi: schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd version="2.5">
In 10g:-



In 11g:-




Wednesday, November 9, 2011

Oracle SOA Suite 10g to 11g Migration – Migrating XREF Runtime Data.

Oracle SOA Suite 10g to 11g Migration – Migrating XREF Runtime Data:


If you have Oracle SOA Suite 10g cross reference (XREF) runtime data in an Oracle database (oraesb.XREF_DATA) then the same needs to be migrated to Oracle SOA Suite 11g (SOAINFRA.XREF_DATA).

The utility is required, as the XREF database schema table (XREF_DATA) has changed for Oracle Fusion Middleware 11g.
We had around 12 million records in our 10g environment and used the utility 

Upgrade10gXrefTo11gXref.sql provided by oracle to migrate the data.
This utility is using the DBLINK to get the data from 10g database because of this the migration was taking more time and could not able to complete.

We have done some modification to the SQL utility based our requirement and we were able to migrate the data successfully within 9hrs of time.
Instead of using the DBLIINK, we have used the Oracle DataPump Utility to transfer the data from Oracle SOA 10g database to Oracle SOA 11g database schema(SOAINFRA –Where the 11g XREF data is available ) and used the local table in the utility script.

The steps to execute the script:

- Using Oracle DataPump Utility, transfer the data from the table oraesb.XREF_DATA of SOA 10g source database to SOA 11g destination database table SOAINFRA.XREF_DATA_MIGRATION (the schema where the 11g XREF data is available).
- Change the MDS location 'oramds: /apps/EAIMetaData/Xref/' in the script, location where the XREF meta data has stored, with your value.
- Log in to Oracle database that hosts the Oracle SOA 11g XREF data as the SOAINFRA user and execute the script.
@Upgrade10gXrefTo11gXref.sql

All the corrupted/duplicated data will be inserted into the table XREF_DATA_CORRUPTED.
Refer the script attached with this blog

Upgrade10gXrefTo11gXref.sql