Monday May 21, 2012

Which JDK is my FMW 11g WebLogic Domain Configured to Use?

Introduction

If you are the administrator who ran the Fusion Middleware Installer or Configuration Wizard, the question in the title may seem a little daft. But, in fact the advice below may become handy should you face one of the following situations:

  • You have been asked to look after a Middleware Home which was previously built by someone else
  • You are configuring a new FMW 11g AS Instance, and unexpectedly hitting errors or hanging at the WebLogic Domain Creation time. For example, see:

    FMW 11g "IDM" or "Portal/Forms/Reports/Discoverer" Configuration Wizards on 64bit Platforms Hang at 0% 'Creating Domain'  [ID 865462.1]

    This support document describes what happens if you inadvertently attempt to configure an AS Instance with a mixture of 64bit (Oracle Home Binaries - ORACLE_HOME) and 32bit JDK (WebLogic Binary Home - WL_HOME)

There are two parts to the question:

  1. What version of JDK will the Configuration Wizard, by default, configure a new WebLogic Domain to use?
  2. Which JDK and version is being used by an existing WebLogic Domain?

JDK Used at WebLogic Domain Creation Time

The answer is in the default WebLogic environment script:

Unix

WL_HOME/common/bin/commEnv.sh

MS Windows

WL_HOME/common/bin/commEnv.cmd

(e.g WL_HOME is typically - MW_HOME/wlserver_10.3/common/bin/commEnv.sh)

Look for lines like the ones below (examples are from a WLS install on a Unix machine)

#JAVA_USE_64BIT, true if JVM uses 64 bit operations
JAVA_USE_64BIT=true
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; <---- This line means if 
JAVA_HOME OR JAVA_VENDOR is NOT set, so if either of them are empty 
the settings in the "then" part of the statement are applied. 
If JAVA_VENDOR and JAVA_HOME are both set then the if statement is skipped
then
      # Set up JAVA HOME
      JAVA_HOME="/oracle/SOAWC/jdk1.6.0_24"
      # Set up JAVA VENDOR, possible values are
      #Oracle, HP, IBM, Sun ...
      JAVA_VENDOR=Sun
      # PRODUCTION_MODE, default to the development mode
      PRODUCTION_MODE=""
fi

Important to Note: It is possible to set JAVA_HOME, JAVA_VENDOR environment variables prior to launching the Installer or Configuration Wizard. Therefore you cannot always assume that commEnv.sh is the source of these environment variable values. In the same session from which you launch the Installer or Configuration Wizard double check whether JAVA_HOME and JAVA_VENDOR have values e.g.

Unix:

echo $JAVA_HOME
echo $JAVA_VENDOR

MS Windows:

set $JAVA_HOME
set $JAVA_VENDOR 

If either of these environment variables are not set then you know that the values will be derived from the commEnv.sh.

The JAVA_HOME and JAVA_VENDOR values do not tell you whether the JDK is 32bit or 64bit. To find out this detail you need to run a switch to the bin directory where the JDK resides e.g

cd /oracle/SOAWC/jdk1.6.0_24/bin 

and then run the java version command. To quote from:

How to tell if Weblogic Server is running in 32-bit or 64-bit mode [ID 1066808.1]

"To identify if you have a 32-bit or 64-bit JDK installed you can run"

java -version

which will give you more information.

By running

java -d64 -version

you can test if the 64-bit mode is supported by your JVM. You will get an error message if this is a 32-bit only JVM. 32/64-bit-hybrid JVMs exist for some platforms. In this case you would have to include the -d64 flag to tell the JVM to run in 64-bit mode."

Which JDK is my existing WebLogic Domain using?

Typically, the JDK used by a WebLogic Domain will be the same as specified by commEnv.sh. However, you must check the domain's environment variable setting file:

Unix:

DOMAIN_HOME/bin/setDomainEnv.sh

MS Windows:

DOMAIN_HOME/bin/setDomainEnv.cmd

(e.g A DOMAIN_HOME might look something like MW_HOME/user_projects/domains/myDomain/)

Couple of examples (taken from installs on a Unix machine)

A Portal / Forms / Reports and/or Discoverer WebLogic Domain; the setDomainEnv has these lines

BEA_JAVA_HOME="/oracle/app/product/oracle/FMW11gR1PS1/jrockit_160_14_R27.6.5-32"
export BEA_JAVA_HOME

SUN_JAVA_HOME="/oracle/app/product/oracle/FMW11gR1PS1/jdk160_14_R27.6.5-32"
export SUN_JAVA_HOME

    if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
        JAVA_HOME="${BEA_JAVA_HOME}"
        export JAVA_HOME
    else
    if [ "${JAVA_VENDOR}" = "Sun" ] ; then
        JAVA_HOME="${SUN_JAVA_HOME}"
        export JAVA_HOME
    else
        JAVA_VENDOR="Oracle"
        export JAVA_VENDOR
        JAVA_HOME="/oracle/app/product/oracle/FMW11gR1PS1/jrockit_160_14_R27.6.5-32"
        export JAVA_HOME
    fi
    fi

A FMW 11g SOA Suite, the setDomainEnv has these lines

    if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
            JAVA_HOME="${BEA_JAVA_HOME}"
            export JAVA_HOME
    else
            if [ "${JAVA_VENDOR}" = "Sun" ] ; then
                    JAVA_HOME="${SUN_JAVA_HOME}"
                    export JAVA_HOME
            else
                    JAVA_VENDOR="Sun"
                    export JAVA_VENDOR
                    JAVA_HOME="/oracle/SOAWC/jdk1.6.0_24"
                    export JAVA_HOME
            fi
    fi

The JAVA_VENDOR environment variable is not normally set prior to running setDomainEnv.sh, in which case the JAVA_VENDOR will default to the "else" part of the statement (highlighted in Red)

The commEnv (.sh or .cmd) is invoked later on in the setDomainEnv script. In the commEnv script the if statement

if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; 

is bypassed because both JAVA_VENDOR and JAVA_HOME have been set.

Again, the setDomainEnv.sh does not tell you whether the specified JAVA_HOME is 32bit or 64bit. The only way to find this information is to run the "java -version" as previously described.

Additional Useful Reference:

How To Change Type of JDK (Sun / JRockit) for FMW 11g Domain (ID 1058804.1)

Note - however I have added a comment to this support document as I believe the advice does not take into account the possibility of JAVA_VENDOR and JAVA_HOME being set before commEnv is launched.

About

This is the blog of the Oracle Fusion Middleware Proactive Support Delivery Team. Here we will provide information about our activities, publications, product related information and more. Feedback welcome.

Follow OracleMWSupport on Twitter

Search

Archives
« May 2012 »
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
31
  
       
Today