Thursday 11 July 2013

SOA 10.1.3.5 on WLS as a windows service

PROBLEM STATEMENT:
-----------------
When attempting to start SOA 10.1.3.5 on WLS as a windows service , the following exception
is observed:
java.lang.NoClassDefFoundError: oracle/tip/adapter/db/IDBConnection
java.lang.NoClassDefFoundError: oracle/tip/adapter/db/DBConnectionFactory
on: java.lang.NoClassDefFoundError: oracle/toplink/platform/server/was/WebSphere_5_1_Platform.
java.lang.NoClassDefFoundError: oracle/tip/esb/model/repository/Repository
java.lang.NoClassDefFoundError: com/cfluent/log4j/Category
etc.....


EXPLANATION & RESOLUTION
-------------------------
The NoClassDefFoundError is encountered because some required libraries are missing from the CLASSPATH.
Check for the following pointers:

A. Missing absolute directory in java.class.path -
java.class.path = \toplink\jlib\toplink.jar;\lib\xmlparserv2.jar;........
\bpel\domains\default\tmp\.generated;\bpel\system\classes ......
\bpel\lib\oracle.soa.10.1.3.5.0.jar;\soa\connectors\oracle.soa.adapters.10.1.3
.5.0.jar.........

B. Missing absolute directory in orabpel.home/oraesb.home -
orabpel.home = \bpel
oraesb.home = \integration\esb

C. Missing entry for environment variable : oracle.home


The classpath entries and the environment variables (orabpel.home ,
oraesb.home,oracle.home) should be preceded by absolute SOA_HOME directory.
This value is made available via the environment variable SOA10G_ORACLE_HOME
in setDomainEnv.cmd

Snippet of setDomainEnv.cmd:
set SOA10G_ORACLE_HOME=C:\product\10.1.3.1\SOAWLS\OracleSOA
.....
-Doracle.home=%SOA10G_ORACLE_HOME% -Dorabpel.home=%SOA10G_ORACLE_HOME%\bpel
-Doraesb.home=%SOA10G_ORACLE_HOME%\integration\esb
.....
EXT_PRE_CLASSPATH=%SOA10G_ORACLE_HOME%\toplink\jlib\toplink.jar;%SOA10G_ORACLE
_HOME%\lib\xmlparserv2.jar
....
POST_CLASSPATH= ....
%SOA10G_ORACLE_HOME%\bpel\lib\oracle.soa.10.1.3.5.0.jar;%SOA10G_ORACLE_HOME%\s
oa\connectors\oracle.soa.adapters.10.1.3.5.0.jar ....


The value of SOA10G_ORACLE_HOME is used in setDomainEnv.cmd to prepend the
SOA_HOME to the variables. However , in the somes cases the value for
SOA10G_ORACLE_HOME seems to be empty ("") , hence the system properties ,
classpath entries etc.. are built incorrectly.


SOLUTION 1: RE-INSTALL SOA AS WINDOWS SERVICE
----------------------------------------------
Please make sure that the value for SOA10G_ORACLE_HOME in setDomainEnv.cmd
points to the SOA_HOME.
(e.g)set SOA10G_ORACLE_HOME=C:\product\10.1.3.1\WLS\OracleSOA
.
Uninstall the SOA Window Service.
Re-Install the SOA Window Service
Start SOA server.
The log should indicate the environment variables as follows :
orabpel.home = C:\product\10.1.3.1\SOAWLS\OracleSOA\bpel
oracle.home = C:\product\10.1.3.1\SOAWLS\OracleSOA
oraesb.home = C:\product\10.1.3.1\SOAWLS\OracleSOA\integration\esb
.....
java.class.path =
C:\product\10.1.3.1\SOAWLS\OracleSOA\toplink\jlib\toplink.jar;C:\product\10.1.
3.1\SOAWLS\OracleSOA\lib\xmlparserv2.jar;
........
.
SOLUTION 2:MODIFY THE REGISTRY MANUALLY
---------------------------------------
From Registry Editor , navigate to
HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->{SOA_SERVICE}->Parame
ters->
Copy the Value Data for CmdLine into a Text Editor.
[make sure to back up the original values]
Search for "-classpath" . prepend the value for SOA10G_ORACLE_HOME to the
following libraries :
{SOA10G_ORACLE_HOME}\toplink\jlib\toplink.jar;
{SOA10G_ORACLE_HOME}\lib\xmlparserv2.jar;
{SOA10G_ORACLE_HOME}\bpel\domains\default\tmp\.generated;
{SOA10G_ORACLE_HOME}\bpel\system\classes;
{SOA10G_ORACLE_HOME}\bpel\system\services\config;
{SOA10G_ORACLE_HOME}\bpel\system\services\schema;
{SOA10G_ORACLE_HOME}\integration\esb\config;
{SOA10G_ORACLE_HOME}\integration\esb\system\classes;
{SOA10G_ORACLE_HOME}\owsm\lib\custom;
{SOA10G_ORACLE_HOME}\bpel\lib\oracle.soa.10.1.3.5.0.jar;
{SOA10G_ORACLE_HOME}\soa\connectors\oracle.soa.adapters.10.1.3.5.0.jar;
.
Search for -Dorabpel.home  & -Doraesb.home . prepend the value for
SOA10G_ORACLE_HOME
-Dorabpel.home={SOA10G_ORACLE_HOME}\bpel
-Doraesb.home={SOA10G_ORACLE_HOME}\integration\esb


Add a new entry for oracle.home
-Doracle.home={SOA10G_ORACLE_HOME}

Where {SOA10G_ORACLE_HOME} = PATH_TO_SOA
(e.g) C:\product\10.1.3.1\SOAWLS\OracleSOA

Paste the modified value into CmdLine.
Start SOA server.
The log should indicate the environment variables as follows :
orabpel.home = C:\product\10.1.3.1\SOAWLS\OracleSOA\bpel
oracle.home = C:\product\10.1.3.1\SOAWLS\OracleSOA
oraesb.home = C:\product\10.1.3.1\SOAWLS\OracleSOA\integration\esb
.....
java.class.path =
C:\product\10.1.3.1\SOAWLS\OracleSOA\toplink\jlib\toplink.jar;C:\product\10.1.
3.1\SOAWLS\OracleSOA\lib\xmlparserv2.jar;
........

No comments:

Post a Comment