Thursday 19 January 2012

My first Experience of OSB11gR1PS2 artifact harvesting into OER 11.1.1.4


Oracle Enterprise Repository 11.1.1.4.0 (OER) comes with its instance of harvester tool, which is supposed to be used to harvest assets into OER. To use this tool you will have to unzip the 11.1.1.4.0-OER-Harvester.zip file that comes with the OER installation into a directory ($HARVERSTER_HOME). The 11.1.1.4.0-OER-Harvester.zip file can be found under <Repositoryxxx_Home>\core\tools\solutions directory.  After you have exploded the contents of the zip file in $HARVERSTER_HOME, you can find the directories and files that are used to configure the harvester framework. The files/directories listed below must not be modified.
  - lib/*
  - plugins/*
  - L10N/*
  - *.jar
  - adapters.xml
  - types.properties

This folder also contains the following:
- encrypt.*                [Command line script to encrypt passwords in the HarvesterSettings .xml  document]
- log4fl.properties        [ Describes logging configuration ]
- HarvesterSettings.xml    [ default settings file used by the harvester]
- setenv.*                 [ Command line scripts to set the environment ]
- osb11g-harvest.*         [ Command line scripts to run the harvester ]
- osb11g-harvester-ant.xml [ ANT build file defining the default ANT targets
                               that can be used to harvest ]
- wlst.*                   [ Command line scripts to execute WLST scripts ]

As per Oracle documentation you will need to set  JAVA_HOME and BEA_HOME environment variables on your local environment as a pre-requisite. Then you can harvest using either of the following methods:
·         Command Line harvesting
·         WLST harvesting
·         ANT harvesting
I used the Command Line harvesting which by far is the simplest way to harvest. For that you would need to update the HarverterSetting.xml file under $HARVERSTER_HOME with OER, OSB connectivity information and information about the OSB Project artifacts to be harvested and run the harvest.bat or harvest.sh command. You may also create your own harvester setting file and specify that as an input to the harvest script with –settings argument along with connectivity and project details for the OSB server and OSB project respectively as follows:

[$HARVERSTER_HOME]>harvest.bat -settings <HarvesterSettingsFileName.xml> -remote_url <httpURLofOSBServer>  -remote_username <UserIdToConnectToOSBServer> -remote_password <EncryptedPasswordToConnectToOSB> -remote_server_type OSB -remote_project <OSBProjectNameToHarvest>
Eg:
[$HARVERSTER_HOME]>harvest.bat -settings HarvesterSettings.xml -remote_url http://localhost:6005 -remote_username weblogic -remote_password v2_1.X5z9eOEncryptedOT+UwdA== -remote_server_type OSB -remote_project MyOSBProject
When I ran this command I stumbled across the following exception:
com.oracle.oer.sync.framework.MetadataIntrospectionException: com.oracle.oer.sync.framework.MetadataIntrospectionException: Unable to read plugin file: C:\Brajesh\Projects\11gUpgrade\OER\11.1.1.4.0-OER-Harvester\harvester\.\plugins\bpmn.introspector
        at com.oracle.oer.sync.framework.MetadataManager.init(MetadataManager.java:310)
        at com.oracle.oer.sync.framework.Introspector.<init>(Introspector.java:201)
        at com.oracle.oer.sync.framework.Introspector.main(Introspector.java:428)
Caused by: com.oracle.oer.sync.framework.MetadataIntrospectionException: Unable to read plugin file: C:\Brajesh\Projects\11gUpgrade\OER\11.1.1.4.0-OER-Harvester\harvester\.\plugins\bpmn.introspector
        at com.oracle.oer.sync.framework.impl.DefaultPluginManager.processIntrospector(DefaultPluginManager.java:127)
        at com.oracle.oer.sync.framework.impl.DefaultPluginManager.<init>(DefaultPluginManager.java:73)
        at com.oracle.oer.sync.framework.MetadataManager.init(MetadataManager.java:308)
        ... 2 more
Caused by: com.oracle.oer.sync.framework.MetadataIntrospectionRuntimeException:
Error: Unable to find asset type in OER: c1b66c2b-a0a5-11df-a365-576b3399627c.
Please make sure that the Harvester Solution Pack is installed in OER.
        at com.oracle.oer.sync.framework.MetadataManager.putAssetType(MetadataManager.java:213)
        at com.oracle.oer.sync.framework.impl.DefaultPluginManager.processIntrospector(DefaultPluginManager.java:104)
        ... 4 more

While googling  to find a solution for this exception, you might find posts saying that this could be because the 11.1.1.x.0-OER-Harvester-Solution-Pack was not imported properly. But that was not the case with me.  After some more R&D I came to know that OSB11gR1P2 comes with its own harvester tool and Oracle recommends using that harvester to harvest assets from OSB11gR1 to OER. So I went ahead and used the OSB11g instance of Harvester which could be located under <OSB11g_HOME>/harvester directory. It has got a README.txt file which gives the details of how to use this version of harvester specially tuned for OSB11g (and that’s why the script is also named as osb11g-harvest.bat and osb11g-harvest.sh for Windows and Linux respectively). It is very simple to use this tool. Just browse to the harvester directory under <OSB11g_HOME> and first execute the setEnv.bat.  That will set all the pre-requisite environment variables required for the harvester tool. Then execute the osb11g-harvest.bat as follows:

[$OSB11g_HARVERSTER_HOME]>osb11g-harvest.bat -settings <HarvesterSettingsFileName.xml> -remote_url <httpURLofOSBServer>  -remote_username <UserIdToConnectToOSBServer> -remote_password <EncryptedPasswordToConnectToOSB> -remote_server_type OSB -remote_project <OSBProjectNameToHarvest>
If everything goes fine (which luckily happened for me unexpectedly) you will see the console output starting with:
[WARN ][jrockit] MaxPermSize=128m ignored: Not a valid option for JRockit
MetadataLoggerConfigurator.initUsingProperties(): Could not find resource [log4fl.properties].
MetadataLoggerConfigurator.initUsingDefault(): Using default settings as Log4flproperties file [log4fl.properties] not found...
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
14:41:53,578  INFO [Main Thread] MetadataManager.?(?) - Oracle Enterprise_Repository_Harvester version: v11.1.1.2.0-100119_0001-1293556
<Jan 19, 2012 2:41:57 PM IST> <Info> <OSB Offline> <BEA-000000> <Initialing ALSB in offline mode. Install dir: C:\OSB11gR1\ORACLE~2 config dir: C:\Users\BRAJES~1\AppData\Local\Temp\OSB11gConfig>
<Jan 19, 2012 2:41:59 PM IST> <Alert> <OSB Security> <BEA-387042> <There is no user password credential mapper provider configured in your security realm. Oracle Service Bus service account management will be disabled. Configure a user password credential mapper provider if you need OSB service account support.>
<Jan 19, 2012 2:42:02 PM IST> <Info> <ALSB Kernel> <BEA-397001> <Initializing type definitions for module "Resource SDK".>
<Jan 19, 2012 2:42:02 PM IST> <Info> <ALSB Kernel> <BEA-397002> <Type definitions for module "Resource SDK" initialized.>
<Jan 19, 2012 2:42:02 PM IST> <Info> <ALSB Kernel> <BEA-397001> <Initializing type definitions for module "Custom Resource SDK".>

And ending with:

<Jan 19, 2012 2:42:04 PM IST> <Info> <ALSB Kernel> <BEA-397004> <Services for module "FLOW Resource" started.>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390020> <Config Service is initializing for the first time>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Project System>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Project _static>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Project default>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Folder System/JNDI Providers>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Folder System/Operator Settings>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Folder System/Proxy Servers>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Folder System/SMTP Servers>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390021> <Creating out-of-the-box location: Folder System/UDDI>
<Jan 19, 2012 2:42:09 PM IST> <Info> <ConfigFwk> <BEA-390022> <Creating out-of-the-box resource: Operations System/Operator Settings/GlobalOperationalSettings>

14:42:10,528  INFO [Main Thread] OSBReader.?(?) - Remote OSB Config Jar export starting.
14:42:11,632  INFO [Main Thread] OSBReader.?(?) - Remote OSB Config Jar export complete.
14:42:11,904  INFO [Main Thread] OSBReader.?(?) - OSB Config Jar Import / Validation starting.
14:42:13,716  INFO [Main Thread] OSBReader.?(?) - OSB Config Jar Import / Validation complete.
14:47:59,913  INFO [Main Thread] MetadataManager.?(?) - Successfully completed the harvest
Starting OERWriter Shutdown and Clean up...

Now if you login to the OER console, you can see your harvested assets there. If you are using the default HarvesterSetting.xml file, the harvested assets would appear in Unsubmitted state

Happy Harvesting !!

No comments:

Post a Comment