Thursday, December 24, 2009

ADF 11: Create Application EAR for test and production deployment respectivly

Status: resolved
Oracle JDeveloper Deploy: 11.1.1.2.0.5536

In this post I want to show how you can easily automate the issue mentioned in Andrejus Baranovskis post about How to do Manual Deployment for ADF 11g Application EAR with Auto Generated JDBC Descriptors.

Introduction

Ok, so what actually is the issue with the Auto Generated JDBC Descriptors in the generated EAR? To understand the problem better I have made up a quick overview

image

You see a typical scenario of a development environment (not optimal but no that bad) On each developers machine there is JDeveloper and the Integrated WebLogic Server installed. If a developer joins a project she checks out the sourcecode, opens it Jdeveloper and is able to run the application. It order to get this working JDeveloper generates the appropriate JDBC descriptors and packages the datasource definition into the EAR which is deployed on the integrated WLS. The application runs on developers machine with zero configuration changes because ‘Auto-generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment' checkbox on the Deployment page of the workspace's Application Properties dialog is activated.

On the right side you see the components on the test/nightly build server with dedicated test database! So the connection information is different from the dev system, the data source in  the WLS must be created manually or script based. For that reason the EAR must not include any datasource definitions because they are obtained from the container (WLS). The EAR is generated by the ojdeploy utility which operates mainly on the application workspace file (.jws)

The problem now is that the ‘Auto-generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment' option is saved in the Application Workspaces file which resides in the SCM repository and both - the developer and Test-Server - obtain there config from a single source!

Solution

Is simple, works but maybe a bit dirty;-) Observing the application workspace file (jws) I recognized the following line

<value n="Weblogic-JDBC-Auto-Sync-Key" v="true"/>

So  switching the value to false before running ojdeploy should do the trick. I have done this with Ant. Create the following files into your workspace

image

as follows

deploy_to_ear.ant.properties
oracle.jdeveloper.workspace.path=C\:\pathto\YourApp.jws
autosync.true=<value n="Weblogic-JDBC-Auto-Sync-Key" v="true"/>
autosync.false=<value n="Weblogic-JDBC-Auto-Sync-Key" v="false"/>

deploy_to_ear.ant.xml
<?xml version="1.0" encoding="windows-1252" ?>
<project name="Deploy Helper Tasks" default="usage" basedir=".">
  <property file="deploy_to_ear.ant.properties"/>
  <target name="usage">
    <echo>Use one of the following targets:</echo>
    <echo>1) disable-wls-jdbc-autosync - desc todo</echo>
    <echo>2) enable-wls-jdbc-autosync  - desc todo</echo>
  </target>
  <target name="disable-wls-jdbc-autosync">
    <replaceregexp match="${autosync.true}"
                   file="${oracle.jdeveloper.workspace.path}"
                   replace="${autosync.false}"/>
  </target>
  <target name="enable-wls-jdbc-autosync">
    <replaceregexp match="${autosync.false}"
                   file="${oracle.jdeveloper.workspace.path}"
                   replace="${autosync.true}"/>
  </target>
</project>

deploy_to_ear.ojdeploy.xml
<?xml version = '1.0' standalone = 'yes' ?>
<ojdeploy-build>
  <deploy>
    <parameter name="workspace" value="${workspace.path}\YourApp.jws"/>
    <parameter name="profile" value="*"/>
    <parameter name="nocompile" value="true"/>
    <parameter name="nodatasources" value="true"/>
    <parameter name="forcerewrite" value="true"/>
    <parameter name="outputfile" value="${workspace.path}/deploy/${ear.filename}"/>
  </deploy>
</ojdeploy-build>

deploy_to_ear.bat
@echo off

echo [INFO] Create deployment EAR for ADF fusion web application

call ant -f deploy_to_ear.ant.xml disable-wls-jdbc-autosync
call ojdeploy -buildfile deploy_to_ear.ojdeploy.xml -define workspace.path=C:\yourpath\to\workspace,ear.filename=testapp1_without_datasources.ear
call ant -f deploy_to_ear.ant.xml enable-wls-jdbc-autosync

Alternatively to run the enable-wls-jdbc-autosync target after ojdeploy has finished you could also do a revert on the .jws file if your SCM system supports it.

In my sample application the generated EAR files look as follows

image

Keep on automating your build process;-)

Saturday, December 12, 2009

Oracle Team Productivity Center (OTPC) – Team Server part

Status: resolved
Oracle Team Productivity Center: 11.1.1.2.0
Oracle WebLogic Server: 10.3.2
Environment: TELDE

Overview

We want to use Oracles solution for Applpication Lifecycle Management (ALM) called Oracle Team Productivity Center. OTPC enables software development teams to collaborate and work productively together when developing applications using JDeveloper.

OTPC consist of several component from which we will cover the server side ones in this blog post. That are the Team Server which is connected to databased repository and some specific ALM connectors. Currently there are implementations for

  • JIRA (since 11.1.1.1.0)
  • MS Project Server (since 11.1.1.1.0)
  • Bugzilla (new in 11.1.1.2.0)

The following figures gives an overview of the involved components:

image

The Team Server component is a WAR exposing some WebServices which are cosumed by the JDeveloper TPC Extension counterpart. The deployement is currently supported either on a WebLogic Server or Apache Tomcat.

Quick Outline of this post

  1. Download OTPC Server Component
  2. Create Database Schema for OTPC
  3. Install  OTPC Server Component on WebLogic Server 10.3.2
  4. Install JDeveloper OTPC extension
  5. Test the OTPC connection.

Download Products

  Product
Download
  Oracle® Team Productivity Center Server Component + Connectors
Download from OTN

Create database schema

Area 
Description 
Putty

login as: oracle
oracle@192.168.234.140's password:
Last login: Mon Aug  3 21:47:45 2009 from 192.168.234.1

[oracle@telde ~]$

[oracle@telde ~]$ . ./setDb1Env.sh

Aktuelle Oracle Umgebung:

Oracle-Home: /u01/app/oracle/product/11.1.0/db_1

Oracle-SID:  orcl

[oracle@telde ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Thu Nov 5 07:40:04 2009

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create user ofm_tpc identified by ofm_tpc;

User created.

SQL> grant connect, resource to ofm_tpc;

Grant succeeded.

SQL> connect ofm_tpc/ofm_tpc;

Connected.

SQL> disconnect;

Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit;

[oracle@telde ~]$

Install OTPC Server Component

Area 
Description 
Client Start Xming!
WinSCP Copy downloaded tpcinstaller.jar to /u01/product/oracle/middleware/11.1.1/tpc
Putty / set java env

Login as oracle

[oracle@telde ~]$ . ./setFusionDomainEnv.sh

/home/oracle

Aktuelle Oracle Umgebung:

$WLS_DOMAIN:               fusion_domain

$WLS_DOMAIN_HOME(=$DH): /u01/app/oracle/product/11.1.1.2/middleware/user_projects/domains/fusion_domain

$MW_HOME:                  /u01/app/oracle/product/11.1.1.2/middleware

$JAVA_HOME:                /u01/app/oracle/product/11.1.1.2/middleware/jrockit_160_14_R27.6.5-32

[oracle@telde ~]$ java -version

java version "1.6.0_14"

Java(TM) SE Runtime Environment (build 1.6.0_14-b08)

BEA JRockit(R) (build R27.6.5-32_o-121899-1.6.0_14-20091001-2113-linux-ia32, compiled mode)

[oracle@telde ~]$ cd /u01/product/oracle/middleware/11.1.1/tpc/ [oracle@telde tpc]$ java -jar tpcinstaller.jar

Installer image
Choose: Next
  image

Input JDBC: jdbc:oracle:thin:@database.telde.local:1521:orcl
Input Username: ofm_tpc
Input Password: ofm_tpc
Choose: Next

  image 
Select: Server
Select: Connectors
Choose: Next
  image 
Input: /u01/app/oracle/product/11.1.1.2/middleware/user_projects/domains/fusion_domain/autodeploy
Choose: Next
  image

Choose File Name: <whatever connector you want to additionally be installed>
Choose: Next

  image 
Input Username: tpcadmin
Input Password: welcome1
Input Confirm Password: welcome1
Choose: Next
  image 
View Summary, Verify your made selections!
Choose: Finish
Installation in progress image
wait…..
  image
Choose: Close
Putty/Start WebLogic

Start the WebLogic server

[oracle@telde tmp]$cd $DOMAIN_HOME

[oracle@telde fusion_domain]./startWebLogic.sh

...

[EL Info]: 2009-11-05 07:47:00.511--ServerSession(41694633)--zip:/u01/app/oracle/product/11.1.1.2/middleware/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/_appsdir_otpc_war/sfdu2u/war/WEB-INF/lib/_wl_cls_gen.jar!/-otpc login successful

Browser/Verify OTPC is running image

Upgrade notes

Test the connection to OTPC from JDeveloper

Area 
Description 
JDeveloper 

Start and Use Help>Check for updates to install the team productivity center extension, plus required client connectors.

  image
Select the Team Navigator tab or Open it by menu (View>Team>Team Navigator)
Click: Connect To Team Server

Input Team Server: telde.local
Input Port: 7001
Input Username: tpcadmin
Input Passwort: welcome1
Choose: Connect
JDeveloper/Team Administration Now you can reach the Team Administration as follows
image 
Now you are able to create user, assign team repositories and so on...

Observations

  • Calling the Test Server Page (<host>:<port>/otpc) you just get a simple message “Oracle Team Productivity Center” Request to Oracle: Please display some more information: Version, active connectors, etc.....!!! At the moment this does not look enterprise production ready!! Sorry. It looks like a prototyp so far……
  • Do I really have to create all the users into the OTPC repository by hand? Can’t I connect to an LDAP-Server? This also looks not enterprise production ready. Sorry.

Further Information

Monday, December 7, 2009

DOAG09: Deployment of ADF fusion web applications on Oracle WebLogic Server 11g

 

This year at DAOG 2009 (the german oracle user group) I had the chance to give a presentation on the interesting topic “deployment of adf applications on Oracle WebLogic Server 11g”.image

From my point of view it is interesting because there are some issues you need to consinder when deploying your adf fusion web app to a standalone WebLogic Server in your Test oder Production environment. It is not always as easy as deploying just to the local integrated WebLogic Server.

 

The following points are covered

  • Installation WebLogic Server 11g
  • Configuration WebLogic Domain for ADF11g/10g
  • Introduction of various deployment options: Jdev Remote, Console/EM, Ant, WLST
  • Deployment guide for needed artefacts: datasource, meta data service repository, security configuration
  • Overview deployment & needed configuration changes in clustered environment
  • Some best practices, some WLST fragments

Download: Deployment von ADF-Applikationen auf den Oracle WebLogic Server 11g

Language: only in german