Do your SOA deployments & configuration with AIA

Bookmark and Share
One of the Application Integration Architecture (AIA) hidden gems is the SOA Suite / FMW deployment framework. This ANT framework can (un)deploy your WARS, SOA Composites, MDS, create JDBC Datasources & JMS Resources like Queues, Topics, Connection Factories , Deploy AQ, JMS, DB Resource Adapters and restart your WebLogic Server and can even do more things like update your WSDL. create users etc.



Before you install AIA you should know this is not license free, but this can save you a lot of money and helps you to reduce the human factor in your deployments.



This deployment framework is part of a bigger AIA plan and is based on Oracle Best practices, but this can also be used for environments where they don't work with AIA.



To use this deployment framework you should have a running SOA Suite & installed AIA on a machine. For installation instructions see my Whitehorses blog.



And here is the official documentation of this deployment framework.



The first step is to add your WebLogic ( SOA Suite ) Server and Database connections details to the AIAInstallProperties.xml file, this located in your AIA instance folder, in my case (

C:\oracle\AIAPS3\aia_instances\AIAInst1\config ).



Add your Database connections under /properties/participatingapplications/AIAEmployeeSync/db

AIAEmployeeSync is my demo application.



Add your WebLogic connections under /properties/pips/AIAEmployeeSync/server



In my case the password are already encrypted, but you need to encrypt them again. So set the isencrypted element to false and replace the encrypted password with their plain text values.

Now you can run a utility to encrypt it again.

open a command windows

cd C:\oracle\AIAPS3\util

c:\oracle\AIAPS3\aia_instances\AIAInst1\bin\aiaenv.bat

ant -f createStore.xml generate -DPropertiesFile=%AIA_INSTANCE%\config\AIAInstallProperties.xml



This will encrypt all the password fields.



Now we can take a look at the deployment plan. Here you see for example the scott Datasource which we just configured in the AIAInstallProperties xml file and it has also a reference to the WebLogic server where it needs to deployed to. With ManagedServer you can reboot the WebLogic server and UpdateMetadata does the necessary MDS updates.

<DeploymentPlan component="AIAEmployeeSync" version="3.0">
<PreInstallScript>
</PreInstallScript>
<Configurations>
<!--
<EndpointConfigurator target-server="pips.AIAEmployeeSync" dir="${AIA_HOME}">
</EndpointConfigurator>
-->
<Datasource name="scott" jndiLocation="jdbc/scott" action="create" 
database="participatingapplications.AIAEmployeeSync.db.SCOTT" xa-enabled="true" wlserver="pips.AIAEmployeeSync"/>
<Datasource name="hr" jndiLocation="jdbc/hr" action="create" 
database="participatingapplications.AIAEmployeeSync.db.HR" xa-enabled="true" wlserver="pips.AIAEmployeeSync"/>

<JMSResource wlserver="pips.AIAEmployeeSync" jmsResourceType="Queue"
jmsResourceName="EmployeeQueue"
jmsresourcejndi="jms/aia/EmployeeQueue" action="create"
jmsModuleName="AIAJMSModule"
jmsSubDeploymentName="AIASubDeployment"/>

<JMSResource wlserver="pips.AIAEmployeeSync" jmsResourceType="ConnectionFactory"
jmsResourceName="EmployeeCF"
jmsresourcejndi="jms/aia/EmployeeCF"
action="create" jmsModuleName="AIAJMSModule"
jmsSubDeploymentName="AIASubDeployment"/>

<UpdateMetadata wlserver="pips.AIAEmployeeSync">
<fileset dir="C:/projecten/workspace/11g_prod/AIAEmployeeSyncPS3/mds_sync/app/AIAMetaData">
<include name="AIAComponents/ApplicationObjectLibrary/AIAEmployeeSync/**"/>
<include name="AIAComponents/ApplicationConnectorServiceLibrary/AIAEmployeeSync/**"/>
<include name="AIAComponents/BusinessProcessServiceLibrary/EBF/**"/>
</fileset>
</UpdateMetadata>

<ManagedServer wlserver="pips.AIAEmployeeSync" action="shutdown" failonerror="true"/>

<DbAdapter connection-instance-jndi="eis/DB/hr" datasource-jndi="jdbc/hr" 
xa-enabled="true" action="create" wlserver="pips.AIAEmployeeSync"/>
<DbAdapter connection-instance-jndi="eis/DB/scott" datasource-jndi="jdbc/scott" 
xa-enabled="true" action="create" wlserver="pips.AIAEmployeeSync"/>
<AqAdapter connection-instance-jndi="eis/AQ/hr" datasource-jndi="jdbc/hr" 
xa-enabled="true" action="create" wlserver="pips.AIAEmployeeSync"/>

<JmsAdapter wlserver="pips.AIAEmployeeSync" action="create"
jndi-name="eis/jms/AIAEmployeeCF"
connection-fac-Location="jms/aia/EmployeeCF"
isTopic="false" isTransacted="false"/>

<ManagedServer wlserver="pips.AIAEmployeeSync" action="start" failonerror="true"/>

</Configurations>

<Deployments>
<Application name="AIAEmployeeSyncPS3-CheckWS"
filelocation="C:/projecten/workspace/11g_prod/AIAEmployeeSyncPS3/CheckWS/deploy/AIAEmployeeSyncPS3-CheckWS-context-root.war"
wlserver="pips.AIAEmployeeSync" failonerror="true" action="deploy"/> 

<Composite compositeName="ScottEmployeeAdapter" 
compositedir="C:/projecten/workspace/11g_prod/AIAEmployeeSyncPS3/ScottEmployeeAdapter" 
revision="1.0" wlserver="pips.AIAEmployeeSync" action="deploy"/>
</Deployments>

<PostInstallScript>
</PostInstallScript>
</DeploymentPlan>


You can also make an undeployment plan. This is nice because you can re-test the whole deployment on your test or acceptance server.

<DeploymentPlan component="AIAEmployeeSync" version="3.0">
<PreInstallScript>
</PreInstallScript>

<Deployments>
<Composite compositeName="ScottEmployeeAdapter" 
compositedir="C:/projecten/workspace/11g_prod/AIAEmployeeSyncPS3/ScottEmployeeAdapter" 
revision="1.0" wlserver="pips.AIAEmployeeSync" action="undeploy"/>

<Application name="AIAEmployeeSyncPS3-CheckWS"
filelocation="C:/projecten/workspace/11g_prod/AIAEmployeeSyncPS3/CheckWS/deploy/AIAEmployeeSyncPS3-CheckWS-context-root.war"
wlserver="pips.AIAEmployeeSync" failonerror="true" action="undeploy"/>   
</Deployments>


<Configurations>


<DeleteMetadata dir="AIAComponents/ApplicationObjectLibrary/AIAEmployeeSync" wlserver="fp"/>
<DeleteMetadata dir="AIAComponents/ApplicationConnectorServiceLibrary/AIAEmployeeSync" wlserver="fp"/>
<DeleteMetadata dir="AIAComponents/BusinessProcessServiceLibrary/EBF" wlserver="fp"/>

<DbAdapter connection-instance-jndi="eis/DB/hr" datasource-jndi="jdbc/hr" 
xa-enabled="true" action="delete" wlserver="pips.AIAEmployeeSync"/>
<DbAdapter connection-instance-jndi="eis/DB/scott" datasource-jndi="jdbc/scott" 
xa-enabled="true" action="delete" wlserver="pips.AIAEmployeeSync"/>
<AqAdapter connection-instance-jndi="eis/AQ/hr" datasource-jndi="jdbc/hr" 
xa-enabled="true" action="delete" wlserver="pips.AIAEmployeeSync"/>

<JmsAdapter wlserver="pips.AIAEmployeeSync" action="delete"
jndi-name="eis/jms/AIAEmployeeCF"
connection-fac-Location="jms/aia/EmployeeCF"
isTopic="false" isTransacted="false"/>

<Datasource name="scott" jndiLocation="jdbc/scott" action="delete" 
database="participatingapplications.AIAEmployeeSync.db.SCOTT" xa-enabled="true" wlserver="pips.AIAEmployeeSync"/>
<Datasource name="hr" jndiLocation="jdbc/hr" action="delete" 
database="participatingapplications.AIAEmployeeSync.db.HR" xa-enabled="true" wlserver="pips.AIAEmployeeSync"/>

<JMSResource wlserver="pips.AIAEmployeeSync" jmsResourceType="Queue"
jmsResourceName="EmployeeQueue"
jmsresourcejndi="jms/aia/EmployeeQueue" action="delete"
jmsModuleName="AIAJMSModule"
jmsSubDeploymentName="AIASubDeployment"/>

<JMSResource wlserver="pips.AIAEmployeeSync" jmsResourceType="ConnectionFactory"
jmsResourceName="EmployeeCF"
jmsresourcejndi="jms/aia/EmployeeCF"
action="delete" jmsModuleName="AIAJMSModule"
jmsSubDeploymentName="AIASubDeployment"/>


<ManagedServer wlserver="pips.AIAEmployeeSync" action="shutdown" failonerror="true"/>

<ManagedServer wlserver="pips.AIAEmployeeSync" action="start" failonerror="true"/>

</Configurations>



<PostInstallScript>
</PostInstallScript>
</DeploymentPlan>


I made a handy start script to start this deployment

<?xml version="1.0"?>


<project name="deployEmployeeSync" default="InstallEmployeeSync" basedir="." >
<property name="process.dir" value="${basedir}"/>

<property environment="env"/>
<property name="aia.home" value="${env.AIA_HOME}"/>
<property name="soa.home" value="${env.SOA_HOME}"/>
<property name="mw.home" value="${env.MW_HOME}"/>
<property name="aia.instance" value="${env.AIA_INSTANCE}"/>


<fail message="Please set the AIA_HOME as environment variable">
<condition>
<not>
<isset property="env.AIA_HOME" />
</not>
</condition>
</fail>

<fail message="Please set the SOA_HOME as environment variable">
<condition>
<not>
<isset property="env.SOA_HOME" />
</not>
</condition>
</fail>

<fail message="Please set the MW_HOME as environment variable">
<condition>
<not>
<isset property="env.MW_HOME" />
</not>
</condition>
</fail>


<fail message="Please set the AIA_INSTANCE as environment variable">
<condition>
<not>
<isset property="env.AIA_INSTANCE" />
</not>
</condition>
</fail>

<target name="InstallEmployeeSync">
<echo>
/------------------------------------------------------------\
!                                                            !
!      Setting the environment to install                    ! 
!           AIA EmployeeSync                                !
!                                                            !
\------------------------------------------------------------/
</echo>


<echo>
/----------------------------------------------------------\
!                                                          !
!         Installing AIA EmployeeSync                              !        
!                                                          !   
\----------------------------------------------------------/
</echo>

<antcall target="AID" />

<echo>
/---------------------------------------------------------------\
!                                                               !
!       Deployment of AIA EmployeeSync completed                        !
!                                                               !   
\---------------------------------------------------------------/

</echo>
</target>

<target name="AID" >

<ant antfile="${aia.home}/Infrastructure/Install/AID/AIAInstallDriver.xml" output="${process.dir}/EmployeeSyncInstall.log" inheritall="false">
<property name="DeploymentPlan" value="${process.dir}/deployment_plan.xml" />
<property name="PropertiesFile" value="${aia.instance}/config/AIAInstallProperties.xml" />
</ant>

</target>

</project>


Also for the undeploy

<?xml version="1.0"?>

<project name="deployEmployeeSync" default="UnInstallEmployeeSync" basedir="." >
<property name="process.dir" value="${basedir}"/>

<property environment="env"/>
<property name="aia.home" value="${env.AIA_HOME}"/>
<property name="soa.home" value="${env.SOA_HOME}"/>
<property name="mw.home" value="${env.MW_HOME}"/>
<property name="aia.instance" value="${env.AIA_INSTANCE}"/>


<fail message="Please set the AIA_HOME as environment variable (i.e. source aiaenv.sh)">
<condition>
<not>
<isset property="env.AIA_HOME" />
</not>
</condition>
</fail>

<fail message="Please set the SOA_HOME as environment variable (i.e. source aiaenv.sh)">
<condition>
<not>
<isset property="env.SOA_HOME" />
</not>
</condition>
</fail>

<fail message="Please set the MW_HOME as environment variable (i.e. source aiaenv.sh)">
<condition>
<not>
<isset property="env.MW_HOME" />
</not>
</condition>
</fail>


<fail message="Please set the AIA_INSTANCE as environment variable">
<condition>
<not>
<isset property="env.AIA_INSTANCE" />
</not>
</condition>
</fail>

<target name="UnInstallEmployeeSync">
<echo>
/------------------------------------------------------------\
!                                                            !
!      Setting the environment to uninstall                    ! 
!           AIA EmployeeSync                                !
!                                                            !
\------------------------------------------------------------/
</echo>


<echo>
/----------------------------------------------------------\
!                                                          !
!         UnInstalling AIA EmployeeSync                              !        
!                                                          !   
\----------------------------------------------------------/
</echo>

<antcall target="AID" />

<echo>
/--------------------------------------------------------------------------------------------\
!                                                                                             !
!       Undeployment of AIA EmployeeSync completed                !
!                                                                                            !
!                                                                                            !   
\-------------------------------------------------------------------------------------------/

</echo>
</target>

<target name="AID" >

<ant antfile="${aia.home}/Infrastructure/Install/AID/AIAInstallDriver.xml" target="Uninstall" output="${process.dir}/EmployeeSyncUnInstall.log" inheritall="false">
<property name="DeploymentPlan" value="${process.dir}/undeployment_plan.xml" />
<property name="PropertiesFile" value="${aia.instance}/config/AIAInstallProperties.xml" />
</ant>

</target>

</project>


We are reading to start the deployment.

open a command window and go the location of your ANT xml's

cd C:\projecten\workspace\11g_prod\AIAEmployeeSyncPS3\config

C:\oracle\AIAPS3\aia_instances\AIAInst1\bin\aiaenv.bat

ant -f deployEmployeeSync.xml




And if everything is Ok you should have everything installed & deployed, but you can always check your deployment log for errors.



When you look for your Resource Adapter definitions then you should look for AIA_XXX



But you can't change the EIS Connections because these are generated, so you need to do this with this AIA deployment framework.



The End

{ 0 comments... Views All / Send Comment! }

Post a Comment