Monday, December 07, 2009

Oracle Fusion Middleware 11g purge scripts available on Oracle Metalink

On Oracle Metalink there is now a Note available that describes the usage of the FMW 11g purge scripts. Note 815896.1 contains all the details.

An OPatch patch 8328187 is available for download that contains all the scripts that are required to create the purging functionality in the SOA_INFRA schema

How to set-up a common Ant project for using the Oracle FMW 11g B2B Ant tasks

Inspired by this great blog posting about how to use the FMW Ant tasks to deploy a SOA composite, I started to use that example to set up my own Ant project for B2B management purposes.

In this blog-posting, I will give an example project that is capable of importing and exporting CPAs to and from Oracle FMW 11g B2B.

Setup the build project
In JDeveloper, create an empty project and name it fmw-build for example. Create the following *.properties
  • env.properties
  • dev.jndi.properties
  • dev.cpacpp.properties
Also, import the ant-b2b-util.xml and the ant-soa-common.xml files that are located in JDEV_HOME\bin folder.

The b2bmanagement.properties files contains all the enviroment specific properties and I used the following contents:

  1. deployment.plan.environment=dev  
  2.     
  3. #dev deployment server weblogic  
  4. dev.serverURL=http://localhost:8001  
  5. dev.overwrite=true  
  6. dev.user=weblogic  
  7. dev.password=welcome1  
  8. dev.forceDefault=true  
  9.   
  10.   
  11. # global  
  12. wn.bea.home=/home/tomhofte/oracle/fmw11gr2  
  13. oracle_home=${wn.bea.home}/Oracle_SOA1  
  14. java.passed.home=/home/tomhofte/java/jdk1.6.0_17  
  15. wl_home=${wn.bea.home}/wlserver_10.3  
  16.   
  17. libs=/home/tomhofte/libs  
  18. path.to.antcontrib.lib=${libs}/ant-contrib/ant-contrib-1.0b3.jar  
  19.   
  20.   
  21. dev.JAVA_HOME=/home/tomhofte/java/jdk1.6.0_17  
  22. #Empty home is enough to let it work  
  23. dev.ANT_HOME=  


The dev.jndi.properties file contains the jndi properties of my local development environment. I used the following contents:

  1. java.naming.provider.url=t3://localhost:8001  
  2. java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory  
  3. java.naming.security.principal=weblogic  
  4. java.naming.security.credentials=welcome1  


The dev.cpacpp.properties contains the cpa/cpp import/export properties for my local development environment. Please have a look here for more information about this part. Please note that for importing exporting a CPA you first have to export the design repository and specify the resulting zip file as the input for the CPA/CPP export utility. The contents I used are:

  1. # CPP/A Output files  
  2. oracle.tip.b2b.ebms.OutputFolder=b2b-tmp/output/  
  3.   
  4. # Oracle B2B Metadata File in case of CPA Export  
  5. oracle.tip.b2b.ebms.Document=b2b-tmp/output/Paris.zip  
  6.   
  7. # ebXML CPA File incase of CPA Import  
  8. #oracle.tip.b2b.ebms.Document=/tmp/input/cpa-example-2_0.xml  
  9.   
  10.   
  11. # Host Name  
  12. oracle.tip.b2b.ebms.Host=Berlin  
  13. # Host endPoint Details  
  14. oracle.tip.b2b.ebms.HostEndPoint=http://localhost:8001/b2b/transportServlet  
  15. # Host Certificate Alias  
  16. oracle.tip.b2b.ebms.HostCertificateAlias=Berlin  
  17. # Trading Partner Certificate Alias  
  18. oracle.tip.b2b.ebms.TPCertificateAlias=Paris  
  19. # BPSS Export  
  20. oracle.tip.b2b.ebms.BPSSExport=false  
  21.   
  22. #Log config  
  23. oracle.tip.b2b.ebms.LogFolder=b2b-tmp/output/log/  
  24. # DEBUG|INFO|ERROR  
  25. oracle.tip.b2b.ebms.LogLevel=DEBUG  
  26. # text|xml  
  27. oracle.tip.b2b.ebms.LogType=text  


Now that all required property files are in place, I use an Ant wrapper script to call the tasks in the ant-b2b-util.xml file and provide the necessary properties. Just as is done in this posting. Here are the contents of my b2b-management.xml file:

(Note: for layout purposes I had to use explicit XML end tags..:()

  1. <project name="b2bManagement" default="exportCPA">  
  2.    <property file="env.properties"></property>  
  3.    <property environment="env"></property>  
  4.    <property name="env.JAVA_HOME" value="${deployment.plan.environment}.JAVA_HOME"></property>  
  5.    <property name="env.ANT_HOME" value="${deployment.plan.environment}.ANT_HOME"></property>  
  6.    
  7.    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${path.to.antcontrib.lib}"></taskdef>  
  8.    
  9.    <!--     Override the JNDI location     -->  
  10.    <property name="jndi.properties" value="${deployment.plan.environment}.jndi.properties"></property>  
  11.    <dirname property="jndi.prop.folder" file="${jndi.properties}"></dirname>  
  12.   
  13.    <import file="${basedir}/ant-b2b-util.xml"></import>  
  14.   
  15.    <target name="importCPA">  
  16.       <antcall target="b2bcpaimport" inheritall="true" inheritrefs="false">  
  17.        <param name="propfile" value="${deployment.plan.environment}.cpacpp.properties">  
  18.       </antcall>  
  19.    </target>  
  20.   
  21.    <target name="exportCPA">  
  22.       <antcall target="b2bcpaexport" inheritall="true" inheritrefs="false">  
  23.        <param name="propfile" value="${deployment.plan.environment}.cpacpp.properties">  
  24.       </antcall>  
  25.    </target>    
  26. </project>  


Note: In the ant-b2b-util.xml I had to replace the oracle.home property with a oracle_home named property to be able to use my own oracle home property. At least, this is the case when I execute the script from JDeveloper 11g. Apparently, the oracle.home property file is predefined by JDeveloper, because I get an "Override ignored" message.. I think it won't matter when you execute the script from the command line..

More info about the usage of the tasks defined in the ant-b2b-util.xml can be found here:

http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10229/scrpt_imp_exp_dep.htm#CEGBDIDB