Showing posts with label Build. Show all posts
Showing posts with label Build. Show all posts

Sunday, May 15, 2011

Target MDS Repository for ADF Applications Deployment

JDeveloper 11g MDS wizard for ADF application doesn't provide target MDS repository configuration options, you can specify only file based repository location:


Only when deploying ADF application enabled with MDS functionality directly from JDeveloper, wizard asks where we want to target MDS repository and specify partition name:


This works fine, when deploying directly from JDeveloper. However, very often deployments are done from deployment automation (Hudson with OJDeploy, etc.). In those cases, we don't have option to specify target MDS repository through the wizard.

By default, target MDS repository is configured in adf-config.xml as file system repository:


We can try to change this and point to database MDS repository, one that should be used after deployment:


However, OJDeploy fails to locate specified JNDI connection - target MDS location with database details is ignored and not included into deployment package:


If we try to deploy such EAR from Hudson automation, errors for target MDS repository are generated - naturally, because required information is missing. Its same as we would try to deploy EAR through Enterprise Manager, it asks to provide mandatory missing information for target MDS repository:


Possible solutions for automated deployment? Looks like only one - you need to write additional script, which will access packaged EAR and substitute target MDS repository values, right before EAR deployment. This would work, because EAR is already generated - we would simulate target MDS repository wizard action - substitute target MDS repository values in adf-config.xml with database details:


Now EAR contains information about target MDS repository, automated deployment will succeed:


Download sample application - PortalAppMDS.zip. You can find sample adf-config.xml file inside application_root/deploy folder, this file contains target MDS repository configuration with database details.

Thursday, November 19, 2009

Building and Integrating Oracle ADF 11g Applications with OjDeploy Utility

While attending Steve Muench session on OOW'09 I learned about Oracle Fusion Applications Teams' Best Practices. One of the things I was very interested - ojdeploy utility usage in automatic builds. In our project, we are building and maintaining custom Ant scripts to generate EAR file and to deploy it to WLS. However, it creates a lot of extra work, especially while migrating from one Oracle ADF release to another. Some customers are considering to use Maven Integration in JDeveloper 11g R1 PS1 (see article) for integration builds. But, while designing your integration build architecture, you should not forget about powerful ojdeploy utility offered by Oracle and shipped together with JDeveloper 11g. From my point of view, main strengths of ojdeploy are the following:
  • You can build deployment package directly from command line, same as it would be build using JDeveloper 11g wizards
  • Oracle ADF library references are resolved automatically, this means you dont need to maintain complex Ant scripts
For today post I have decided to use application from my previous post - Integration in Oracle ADF with ADF Task Flows and Shared Java Classes. I have created ojdeploy script for this application, you can download complete sample - ADFIntegration5.zip. More info about ojdeploy utility you can find from Steve Muench blog post.

Sample application is based on 3 applications, one of them is main application. First are build two dependent applications and then EAR file is produced based on main application. In the script you need to point to appropriate deployment profiles to be invoked for each application:

Invoke ojdeploy utility from command line (ojdeploy -buildfile ojdeploy-build.xml) and all three applications will be compiled and packaged automatically:

EAR and WAR files are generated for main application, along with ADF Library JAR files for dependent applications:

In order to build and integrate my application, I have defined following deployment profiles:

ADF Library JAR deployment for first dependent application.

ADF Library JAR deployment for second dependent application.

WAR deployment profile for main application.

EAR deployment profile for main application.