Tuesday, June 8, 2010

Tips and Tricks for SAP Adapter

In this post I would like to cover some common installation and runtime issues with Oracle Application adapter for SAP.

Installation guides for SAP adapter : 

SAP Adapter installation on Weblogic 
SAP Adapter installation on 10G AS


Error 1
./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-Red Hat Enterprise Linux AS release 2.1, redhat-Red Hat Enterprise Linux AS release 3, redhat-Red Hat Enterprise Linux AS release 4, redhat-Red Hat Enterprise Linux ES release 3, SuSE-9 or UnitedLinux-1.0
Failed <<<<
Exiting Oracle Universal Installer, log for this session can be found at /opt/apps/OracleAS_1/oraInventory/logs/installActions2010-03-23_09-32-24AM.log


Solution:
./runInstaller -ignoresysprereqs

Error 2
While trying to run the installer on Weblogic server you may run into below error.
$ ./iwora11g.application-adapters.linux.bin
InstallShield Wizard
Initializing InstallShield Wizard...
Searching for Java(tm) Virtual Machine...
The wizard cannot continue because of the following error: could not load wizard specified in /wizard.inf (104)

Solution:
JDK1.6 is a requirement for Oracle Application adapters on weblogic server. You can run the installer as follows to avoid the above error:
$./iwora11g.application-adapters.linux.bin -is:javahome {specify path of jdk1.6}


Error 3
On linux while trying to open Application Explorer by running the iwae.sh script it fails with
./iwae.sh: line 70: 23111 Segmentation fault


Solution:
Before running the script you have to set the environment variable JAVACMD.
Eg: export JAVACMD= /opt/apps/OracleAS_1/jdk/bin/java

Error 4
A very common error which happens if post-installation tasks are not followed correctly.
java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [Can't find dependent libraries] java.library.path.....

Solution:
As part of the SAP adapter post installation task we need the below 3 files:
  • sapjco.jar
  • librfc32.dll / librfccm.so
  • sapjcorfc.dll / libsapjcorfc.so
The SAP Java Connector files can be downloaded from SAPNet at http://service.sap.com/connectors/
A valid SAP service ID is required to access this file. Once logged in, this link redirects you to SAP Service Marketplace. Click the following links to access the SAP Java Connector (SAP JCo) tools and services page:

SAP NetWeaver > SAP NetWeaver in Detail > Application Platform > Connectivity > Connectors > SAP Java Connector > Tools & Services

You can get the JCo ZIP file from the above navigation and extract the 3 files from it. 



For Weblogic
  • Copy the librfccm.so, libsapjcorfc.so and sapjco.jar to WLS_HOME/server/lib and MW_HOME/user_projects/domains/domain_name/lib
  • Also set the LD_LIBRARY_PATH in WLS_HOME/common/bin/commEnv.sh
  • Set the WEBLOGIC_CLASSPATH in same file.
For 10G AS on Windows
  • Copy the sapjco.jar file to ORACLE_HOME\adapters\application\lib directory.
  • Copy the librfc32.dll to C:\Windows\system32 directory and ORACLE_HOME\adapters\application\lib
  • Copy the sapjcorfc.dll to ORACLE_HOME\adapters\application\lib
For 10G AS on Linux
  • Copy the librfccm.so, libsapjcorfc.so and sapjco.jar to ORACLE_HOME/adapters/application/lib directory.
  • Also copy sapjco.jar file to ORACLE_HOME/j2ee/OC4J_SOA/connectors/jca-app-adapter/jca-app-adapter directory.
  • On Linux you also have to set the LD_LIBRARY_PATH . You can edit the opmn.xml file and set the LD_LIBRARY_PATH pointing to the path where the libraries are copied.
Error 5
Error as shown is screenshot can occur while trying to connect to SAP target from Application Explorer.
or the below error message:

SEVERE IWAFManagedConnectionFactory com.iwaysoftware.af.container.adapter.AdapterConfiguration activateAdapter(321) Problem activating adapter.  (java.lang.ExceptionInInitializerError:JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC' JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [/opt/apps/Oracle/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib/ libsapjcorfc.so:wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)]. java.library.path


Solution: 
The problem is because of 64bit/32bit conflict. SAP Adapter can run on 64-bit JVM but only after the correct 64-bit JCO file is used. Incase your OS is 64 bit make sure you download the 64-bit rather than 32-bit JCO files. Also remember Intel has two 64 bit architectures (IA-64 and EMT64/AMD64). So make sure you have downloaded the correct 64bit version files.

Error 6
At runtime most of the BPEL processes invoking SAP adapter (BAPI WSDLs) are failing with error 

Error in parsing the input document.
oracle.xml.parser.v2.XMLParseException: Start of root element expected. 

Solution:
This happens if you haven't applied the madantory base patch 5895585: PLACEHOLDER FOR IWAY ADAPTER RELEASE 10.1.3.1 Incase you have missed this patch initially and are applying later on then please do the below steps:
  • Recreate the target in Application Explorer
  • Regenerate the WSDL files under this new target.
Error 7
Hitting the below error while trying to call SAP BAPIs at different times. 
The Adapter Framework was unable to establish an outbound JCA connection due to the following issue: javax.resource.spi.EISSystemException: IWAFManagedConnectionFactory:Exception javax.resource.ResourceException: Problem activating adapter. (com.ibi.sap.SapAdapterException: com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Connection pool dee68d32f3d3a54a57cb1ad6d5044ae_p1 is exhausted. The current pool size limit (max connections) is 2 connections.)

Solution: 
You need to increase the JCO Connection pool size limit as this controls the number of simultaneous client connections which can be made to a particular RFC destination. This can be set in Application Explorer by editing the target settings.

No comments:

Post a Comment