Installing ADF 11.1.2.4.0 on Red Hat 6

Peter Lorenzen
09/10-2013

Here is my experiences with installing ADF 11.1.2.4.0 on Red Hat 6 (64-bit) using Java 7.

FMW releases are big and complicated. Between the main FMW releases, Oracle release some products on separate “branches”. This is to fast track new features.

ADF 11g Release 2 is such a fast track product. The latest ADF 11g release 1 version is 11.1.1.7 and the latest release 2 is 11.1.2.4.0.

It is important to understand the difference between the two “branches” of ADF.

ADF release 2 should only be used for standalone applications while release 1 can be used for both standalone applications and in conjunction with FMW products like the SOA Suite and WebCenter.

It is NOT supported to upgrade ADF from the main FMW release to release 2, for example in a SOA Suite installation.

Excerpt from the release note:

Important note: The patch is intended to be applied to an Application Developer Runtime installation. Applying the patch to a different installation type (for example, Oracle SOA Suite or Oracle WebCenter) is not supported.

First have a look at the documentation:
Oracle Fusion Middleware Download, Installation, and Configuration ReadMe (11.1.1.7)
Oracle Fusion Middleware Installation Planning Guide (11.1.1.7)
ADF 11.1.2.4.0 Release Notes – Look for “Key Installation steps for new Oracle WebLogic Server Users”

Also have a look at this MOS note:
“How To Install the ADF Runtime Libraries 11g Release 2 in WebLogic Sever 10.3.5 / 10.3.6 ?” [ID 1328698.1]

Overview

Download the software

Please notice

  • Before using the direkt download links to http://download.oracle.com you need to login in to the site and accept a License Agreement. It does not matter which product you choose.

Prepare the OS

I am using Red Hat 6 64-bit. Check the “System Requirements for UNIX Operating Systems”.
Also check “Special Startup Requirements for Linux x86 or Linux x86-64 Operating Systems” in the same document.

This should install the needed packages:

yum install binutils-2*.x86_64 -y
yum install compat-libcap1-1* -y
yum install compat-libstdc++-33*.i686 -y
yum install compat-libstdc++-33*.x86_64 -y
yum install gcc-4*.x86_64 -y
yum install gcc-c++-4*.x86_64 -y
yum install glibc-2*.x86_64 -y
yum install glibc-2*.i686 -y
yum install glibc-devel-2*.i686 -y
yum install libaio-0.*.x86_64 -y
yum install libaio-devel-0.*.x86_64 -y
yum install libgcc-4.*.x86_64 -y
yum install libstdc++-4.*.i686 -y
yum install libstdc++-4.*.x86_64 -y
yum install libstdc++-devel-4.*.x86_64 -y
yum install libXext.i686 -y
yum install libXtst.i686 -y
yum install sysstat-9.*.x86_64 -y
yum install redhat-lsb-4.*.x86_64 -y

Change the open file limits in /etc/security/limits.conf

sed -i '/.*End of file/d' /etc/security/limits.conf
echo "* soft nofile 16384" >> /etc/security/limits.conf
echo "* hard nofile 16384" >> /etc/security/limits.conf
echo "# End of file"  >> /etc/security/limits.conf
cat /etc/security/limits.conf

Change the kernel parameters that need changing. Often the default values are OK.
Normally I only change/add these two and this is really only needed if you use Coherence.

echo "net.core.rmem_max=4192608" >> /etc/sysctl.conf
echo "net.core.wmem_max=4192608" >> /etc/sysctl.conf
/sbin/sysctl -p

Create user, group and directories.

groupadd oinstall
useradd -g oinstall -G oinstall oracle
passwd oracle

mkdir -p /u01/app/oracle/product
mkdir -p /u01/tmp

chown -R oracle:oinstall /u01
chmod -R 750 /u01

Set the umask for the oracle user. If you don’t want to set it in the .bash_profile at least set it manually when installing the software as suggested by Oracle.

su - oracle
echo "umask 027" >> .bash_profile
cat .bash_profile

Enabling Unicode Support in the .bash_profile for the oracle user.

su - oracle
echo "export LANG=\"en_US.UTF-8\"" >> .bash_profile
cat .bash_profile

Install Java

Unzip and untar the downloaded file:

gunzip jdk-7u40-linux-x64.tar.gz
tar xvf jdk-7u40-linux-x64.tar
mv jdk1.7.0_40 /u01/app/oracle/product/.

After I install Java I always create a softlink to the installation directory and reference it everywhere. This makes it is easier later when you have to upgrade.

cd /u01/app/oracle/product
ln -s jdk1.7.0_40 java_current

Install the latest Java SE CPU patch

Check the Java SE Critical Patch Update (CPU) to see if you need to patch the Java you have installed.
The latest Java SE CPU is from June 2013. It patches update 21 and earlier. I use update 40 so there is no need to patch it.

Until now the Java SE CPU has had its own release schedule but from the October CPU it will follow the same schedule as the other Oracle products.

Install the WebLogic Server 10.3.6

Take care when downloading the wls1036_generic.jar file since some browsers will rename it to wls1036_generic.zip.

/u01/app/oracle/product/java_current/bin/java
-Djava.io.tmpdir=/u01/tmp -jar wls1036_generic.jar -log=wls_install.log

-Djava.io.tmpdir is only needed if there is not enough tmp space.

Below I have ignored the screens where you can sign up for security updates etc.





Here the Java soft link is “ignored” so we have to fix this later.



The Java soft link was “ignored” so we have to fix this:

cd /u01/app/oracle/product/adf
grep -R jdk1.7.0_40 *
find . -type f -exec sed -i "s/\/u01\/app\/oracle\/product\/jdk1.7.0_40/\/u01\
/app\/oracle\/product\/java_current/g" {} \;

Install the latest WebLogic Server PSU patch

Oracle releases quarterly security updates. You can read more about CPU, SPU, PSU and BP patches here.

WebLogic 10.3.6 July 2013 PSU 10.3.6.0.5 patch 16619891 (p16619891_1036_Generic.zip)

Make sure all WebLogic servers are stopped and remove any previously applied Patch Set Update and associated overlay patches.

mkdir /u01/app/oracle/product/adf/utils/bsu/cache_dir
cp L51R.jar /u01/app/oracle/product/adf/utils/bsu/cache_dir/.
cp patch-catalog_19570.xml /u01/app/oracle/product/adf/utils/bsu/
cache_dir/patch-catalog.xml
ls -la /u01/app/oracle/product/adf/utils/bsu/cache_dir

Make sure that the patch-catalog_19345.xml is renamed to patch-catalog.xml!

cd /u01/app/oracle/product/adf/utils/bsu/
./bsu.sh -prod_dir=/u01/app/oracle/product/adf/wlserver_10.3
 -patchlist=L51R -verbose -install

Verify that the patch is installed.

./bsu.sh -prod_dir=/u01/app/oracle/product/adf/wlserver_10.3
 -status=applied -verbose -view

Alternative use.

. /u01/app/oracle/product/adf/wlserver_10.3/server/bin/setWLSEnv.sh
java weblogic.version

For example.

[oracle@wintermute ~]$ java weblogic.version

WebLogic Server 10.3.6.0.5 PSU Patch for BUG16619891 Tue Apr 23 13:24:29 IST 2013
WebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050

Install ADF 11.1.1.6

ADF 11.1.1.6 is not certified with Red Hat 6 so you need -ignoreSysPrereqs.

cd /u01/software/adf/ofm_appdev_generic_11.1.1.6.0_disk1_1of1/Disk1
./runInstaller -ignoreSysPrereqs -jreLoc /u01/app/oracle/product/java_current/jre

Below I have ignored the screens where you can sign up for security updates etc.





Notice ADF is being installed in MIDDLEWARE_HOME/oracle_common.


If you press Save you will be prompted for a place to save a response file you can use for silent installation.


If you press Save you will be prompted for a place to store a file with information about the installation.

It contains this.

Install Oracle Application Developer
  Directory Details
          Middleware Home Location: /u01/app/oracle/product/adf
          Oracle Home Location: /u01/app/oracle/product/adf/oracle_common
          Application Server Type: WebLogic Server
          Application Server Location: /u01/app/oracle/product/adf
  Disk Space
          Oracle Home Size: 1019 MB
          Available: 156884 MB
  Applications
          Oracle Enterprise Manager

Install the latest opatch

You should always install the latest opatch from MOS. Even though opatch is an old Oracle tool it keeps getting updated and patched.

[oracle@wintermute ~]$ export ORACLE_HOME=/u01/app/oracle/product/adf/oracle_common
[oracle@wintermute ~]$
[oracle@wintermute ~]$ $ORACLE_HOME/OPatch/opatch lsinventory | grep "OPatch version"
OPatch version    : 11.1.0.9.0
unzip -o p6880880_111000_Linux-x86-64.zip -d /u01/app/oracle/product/adf/oracle_common
[oracle@wintermute ~]$ $ORACLE_HOME/OPatch/opatch lsinventory | grep "OPatch version"
OPatch version    : 11.1.0.10.1

Patch ADF to 11.1.2.4.0

16546129 p16546129_111160_Generic.zip (ADF 11.1.2.4.0)
16546157 p16546157_111160_Generic.zip (ADF 11.1.2.4.0 – EM)

export ORACLE_HOME=/u01/app/oracle/product/adf/oracle_common

cd /u01/software/adf/p16546129_111160_Generic/16546129
$ORACLE_HOME/OPatch/opatch apply

cd /u01/software/adf/p16546157_111160_Generic/16546157
$ORACLE_HOME/OPatch/opatch apply

Check the inventory.

$ORACLE_HOME/OPatch/opatch lsinventory

You will see that there in the oracle_common home is installed one product and two patches.

Other patches

There is currently no other CPU patches or other recommend patches for ADF that I am aware of.

Create an ADF domain

The CONFIG_JVM_ARGS is set to speed things up if the system is low on entropy.

export CONFIG_JVM_ARGS=”-Djava.security.egd=file:/dev/./urandom”
cd /u01/app/oracle/product/adf/wlserver_10.3/common/bin/
./config.sh

Below I have ignored the screens where you can sign up for security updates etc.


Do not select products you do not need! In some situations you can select products that conflics and you will end up with a domain that does not work. “Basic WebLogic SIP Server Domain” is for example not compatible with the SOA Suite.

JRF (Java Required Files) consists of a number of independently developed libraries and applications and include ADF Framework shared libraries and ODL logging handlers.

I like to keep the domains away from the software installation.

In the past I used to not name the default administrator user weblogic on production servers. Just as an extra precaution so you know that you are logging on to a production server. I have never experienced problems with this. But a the UKOUG conference last year I was told by somebody that you can get in trouble with some of the IDM products if there is no weblogic user.


If you do not select any options on this page the configuration wizard will default create an AdminServer with an empty listen address and using port 7001. No Machine is created.

Do not use “All Local Addresses” for the Listen address for any WebLogic server. You should use a DNS alias or if you do not have one an IP. If you use “All Local Addresses” the server will listen on localhost and local IPs, both via IP4 and IP6 depending on the host and for several protocols: iiop, t3, ldap, snmp, http.



If you need to access the Node Manager from a remote host you cannot use localhost.


I normally do not select “Deployments and Services” on the “Select Optional Configuration” page. I have done it here as to show that is is possible to target the ADF components for the Managed Server. If you later create a new Managed Server you will need to target ADF in a different way. I will later show how to do the targeting via WLST and via the Enterprise Manager.

So don’t change anything on the two targeting screens, just press Next.


You can use the Summary View drop-down menu to inspect different details about the installation.

Upgrade ADF in the domain

Before you start your domain you need to execute the below. It will upgrade the ADF configuration in your domain and deploy the JSF 2.0 library.

/u01/app/oracle/product/adf/oracle_common/common/bin/wlst.sh
upgradeADF('/u01/app/oracle/domains/adf')

For example.

wls:/offline> upgradeADF('/u01/app/oracle/domains/adf')
Target Library "jsf#2.0@1.0.0.0_2-0-2" to JRF "AdminServer"

Notice that there also exists an upgradeJRF WLST command. This is used when you upgrade/patch certain FMW releases. You can see when to use it here.

Apply the JRF template to a Managed Server via WLST

Since we did not target the ADF components to the ms01 Managed Server via the domain Wizard we need to do it a different way.

Here we use offline WLST. You can also use the EM for this, which we will try later.

Notice that neither WLST or the EM target the JSF 2.0 library to the Managed Server so make sure you your read the JSF 2.0 problems section.

If you later add another Managed Server you can also use the below.

Stop all servers in the domain if they are running.

/u01/app/oracle/product/adf/oracle_common/common/bin/wlst.sh
applyJRF(target='ms01', domainDir='/u01/app/oracle/domains/adf')

For example.

wls:/offline> applyJRF(target='ms01', domainDir='/u01/app/oracle/domains/adf')
Read domain /u01/app/oracle/domains/adf to applyJRF
Copying JRF configuration files from /u01/app/oracle/product/adf/oracle_common/modules to /u01/app/oracle/domains/adf/config/fmwconfig/servers/ms01
Target JRF components to "ms01"
Update JRF changes to domain /u01/app/oracle/domains/adf in offline mode

Apply the JRF template to a Managed Server via EM

As an alternative to use offline WLST to target the ADF components to a Managed Server you can use the EM.

You of cause need the Admin server running to be able to use the EM. Therefore this section is a bit premature, since we will covert starting and stopping of the servers in the coming sections.

So if the Admin Server is not running you need to start it first.

For this example I have created a new Managed Server called ms02.

Access the EM via http://wintermute:7001/em and navigate to ms02.

Press “Apply JRF Template”

If the ms02 server is running it must be restarted.

Notice that neither WLST or the EM target the JSF 2.0 library to the Managed Server so make sure you your read the JSF 2.0 problems section.

Homes overview

There are several homes:

  • Application Home – /u01/app/oracle/applications/adf
  • Domain Home – /u01/app/oracle/domains/adf
  • Middleware Home – /u01/app/oracle/product/adf
  • Oracle Common Home – /u01/app/oracle/product/adf/oracle_common
  • WebLogic Server Home – /u01/app/oracle/product/adf/wlserver_10.3

For more information check the Oracle Fusion Middleware Installation Planning Guide.

Starting the servers

Start the Admin Server:

cd /u01/app/oracle/domains/adf
./startWebLogic.sh

Wait till you see:

<Server started in RUNNING mode>

Now you should be able to access the Admin Console and the Fusion Middleware Control:

  • http://wintermute:7001/console
  • http://wintermute:7001/em

Start the Managed Server in another terminal:

cd /u01/app/oracle/domains/adf/bin
./startManagedWebLogic.sh ms01

Input username and password when prompted.

When it reaches the Running state check that all the deployments has state Active.

Java parameters

You can set Java memory parameters in several ways. Here I use setDomainEnv.sh in /u01/app/oracle/domains/adf/bin.
I place the below just after all the comments in the top of the file:

Development Mode

# *************************************************************************
# lorenzen Begin 
# *************************************************************************
if [ "${SERVER_NAME}" = "" ] ; then
        SERVER_NAME="AdminServer"
        export SERVER_NAME
fi
if [ "${SERVER_NAME}" = "AdminServer" ] ; then
  USER_MEM_ARGS="-Xms256m -Xmx768m -XX:MaxPermSize=350m -Djava.security.egd=file:/dev/./urandom"
elif [ "${SERVER_NAME}" = "ms01" ] ; then
  USER_MEM_ARGS="-Xms768m -Xmx1024m -XX:MaxPermSize=350m -Djava.security.egd=file:/dev/./urandom"
fi
# *************************************************************************
# lorenzen End
# *************************************************************************

Production Mode

# *************************************************************************
# lorenzen Begin 
# *************************************************************************
if [ "${SERVER_NAME}" = "" ] ; then
        SERVER_NAME="AdminServer"
        export SERVER_NAME
fi
if [ "${SERVER_NAME}" = "AdminServer" ] ; then
  USER_MEM_ARGS="-Xms256m -Xmx768m -XX:MaxPermSize=350m"
elif [ "${SERVER_NAME}" = "ms01" ] ; then
  USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=350m"
fi
# *************************************************************************
# lorenzen End
# *************************************************************************

In Development Mode I have added a parameter to take care of any entropy problems.

In Production Mode -Xms and -Xmx should always contain the same value for Managed Servers.

Configuring the Node Manager

I always use the Node Manager (NM) to start and stop WebLogic servers.

1. Set NM user name and password

Use the Admin Console and navigate to the domain. Select Security and then Advanced. Set “NodeManager Username” and “NodeManager Password”:
nm1

2. Set the NM type to plain

The NM default uses SSL. I normally do not use SSL for the NM and if you do you should use valid SSL certificates not the default demo certificates.
Navigate to Environment => Machines => machine_1 => Node Manager.
Change Type to Plain.
nm2

3. Stop the Admin Server and the Managed Server

Stop them via the Admin Console or just ctrl+c in the two terminals.

4. Start the NM

cd /u01/app/oracle/product/adf/wlserver_10.3/server/bin
./startNodeManager.sh

When you see:

INFO: Secure socket listener started on port 5556

Stop NM again with ctrl+c. The NM has now created it’s setup files and we need to make a couple of changes in nodemanager.properties in:
/u01/app/oracle/product/adf/wlserver_10.3/common/nodemanager

Change these lines:

javaHome=/u01/app/oracle/product/java_current
JavaHome=/u01/app/oracle/product/java_current/jre
ListenAddress=localhost
SecureListener=false
CrashRecoveryEnabled=true
StartScriptEnabled=true

This should do it.

sed -i 's/javaHome=.*/javaHome=\/u01\/app\/oracle\/product\/java_current/g' nodemanager.properties
sed -i 's/JavaHome=.*/javaHome=\/u01\/app\/oracle\/product\/java_current\/jre/g' nodemanager.properties
sed -i 's/ListenAddress=/ListenAddress=localhost/g' nodemanager.properties
sed -i 's/SecureListener=true/SecureListener=false/g' nodemanager.properties
sed -i 's/CrashRecoveryEnabled=false/CrashRecoveryEnabled=true/g' nodemanager.properties
sed -i 's/StartScriptEnabled=false/StartScriptEnabled=true/g' nodemanager.properties

Start the NM again. Wait until you see:

INFO: Plain socket listener started on port 5556

5. Start the Admin Server

In another terminal start the Admin Server:

. /u01/app/oracle/product/adf/wlserver_10.3/server/bin/setWLSEnv.sh
java weblogic.WLST -skipWLSModuleScanning
nmConnect(username='nodemgr', password='welcome2', domainName='adf', domainDir='/u01/app/oracle/domains/adf', nmType='plain')
nmStart('AdminServer')

6. Start the Managed Server

When the Admin Server is Running start the Managed Server via the Admin Console.

Notice that things are a bit different if you use Production Mode.

Configure automatic start of the servers

Now everything is running but of cause the NM should not be started manually but automatically when the server boots.

Stop NM with ctrl+c.

Here is a very simple boot script:
/etc/init.d/adfNodeManager

Log in as root.

cd /etc/init.d
chmod 755 adfNodeManager
chkconfig --add adfNodeManager
chkconfig --list adfNodeManager
./adfNodeManager start

Check that the NM is reachable from the Admin Console.

JSF 2.0 problems

I am not a developer but I assume that one of the reasons people choose ADF release 2 is because it includes JSF 2.0.

If you install and configure ADF 11.1.2.4.0 as outlined here and in the documentation you will end up with having both JSF 1.2 and 2.0 deployed.

Both libraries have the name jsf. This is a bit unusual. If you manually try to deploy an application or library via the Admin Console with a name that already is deployed you will get an error.

You can undeploy JSF 1.2 but if you do that you cannot use applyJRF or the EM to apply the JSF template. They will fail since they cannot find JSF 1.2

wls:/offline>
Read domain /u01/app/oracle/domains/adf to applyJRF
Copying JRF configuration files from /u01/app/oracle/product/adf/oracle_common/modules to /u01/app/oracle/domains/adf/config/fmwconfig/servers/ms02
Target JRF components to "ms02"
Error: unassign() failed. Do dumpStack() to see details.
Error: assign() failed. Do dumpStack() to see details.
Error: unassign() failed. Do dumpStack() to see details.
Error: assign() failed. Do dumpStack() to see details.
Update JRF changes to domain /u01/app/oracle/domains/adf in offline mode
wls:/offline/adf>

So every time you add a Managed Server and have applied the JRF template via WLST or EM, you need to manually untarget JSF 1.2 and target JSF 2.0.

Notice that as soon as you untarget JSF 1.2 the “Apply JRF Template” link will reappear in the EM.

I have created WLST script to help with this.

###############################################################################
# Init
###############################################################################
TARGET        = 'ms02'
#TARGET       = 'wlsCluster'
TARGET_TYPE   = 'Server'
#TARGET_TYPE  = 'Cluster'

domainConfig()
edit()
startEdit()

###############################################################################
# Untarget JSF 1.2 and target JSF 2.0
###############################################################################

libs=cmo.getLibraries()
for lib in libs:
  if lib.getName()[0:7] == 'jsf#1.2':
    print lib.getName()
    cd('/Libraries/'+lib.getName())
    set('Targets',jarray.array([], ObjectName))
  elif lib.getName()[0:7] == 'jsf#2.0':
    print lib.getName()
    cd('/Libraries/'+lib.getName())
    if TARGET_TYPE == 'Server':
      cmo.addTarget(getMBean('/Servers/'+TARGET))
    elif TARGET_TYPE == 'Cluster':
      cmo.addTarget(getMBean('/Clusters/'+TARGET))

save()
activate(block="true")
disconnect()
exit()

Execute the script.

. /u01/app/oracle/product/adf/wlserver_10.3/server/bin/setWLSEnv.sh
java weblogic.WLST -skipWLSModuleScanning
connect(username='weblogic',password='welcome1',url='t3://wintermute:7001')
execfile('targetJSF2.0.py')

Java 7

Have a look at at “Using WebLogic Server with JDK 7“.

mkdir /u01/app/oracle/product/jdk1.7.0_40/jre/lib/endorsed
cd /u01/app/oracle/product/adf/modules
cp javax.annotation_* /u01/app/oracle/product/jdk1.7.0_40/jre/lib/endorsed
cp javax.xml.bind_* /u01/app/oracle/product/jdk1.7.0_40/jre/lib/endorsed
cp javax.xml.ws_* /u01/app/oracle/product/jdk1.7.0_40/jre/lib/endorsed
ls /u01/app/oracle/product/jdk1.7.0_40/jre/lib/endorsed

Restart all servers in the domain.

Miscellaneous

You should audit the Logging settings for the domain and the servers to make sure log rotation is configured.
Notice that .out log files cannot be rotated by WebLogic. The are only rotated when the servers are restarted.
On Windows this is a problem on Linux not so much :-)
But make sure you developers know that:

System.out.println("This is forbidden! Use Java Logging or Log4j");

You should configure “Configuration Archiving” for the domain. Domain => Configuration => General => Advanced. Set “Configuration Archive Enabled” and “Archive Configuration Count”.
When you change the configuration the old configuration files will automatically be save so you can revert to an old version if you get in trouble.

Securing your installation

Have a look at Oracle Fusion Middleware Securing a Production Environment for Oracle WebLogic Server 11g

It is of cause only the top of the iceberg but is a start.

Configure OCM

If your servers has access to the Internet OCM will automatically download the latest version. If not you should download it yourself and install it manually.

. /u01/app/oracle/domains/adf/bin/setDomainEnv.sh
export ORACLE_HOME=/u01/app/oracle/product/adf/utils
export JAVA_HOME=/u01/app/oracle/product/java_current
cd $ORACLE_HOME/ccr/bin
./setupCCR -s 12345678 nobody@cgi.com DK

Verify that it is working:

cd $ORACLE_HOME/ccr/bin
./emCCR start
./emCCR status
./emCCR -register test
./emCCR -verbose test
./emCCR register
./emCCR collect
./emCCR upload
./emCCR disable_target

Feedback

If you feel that I am missing something or find mistakes please tell me. I always want to learn!

Leave a Comment

Previous post:

Next post: