Friday, February 24, 2012

Oracle B2B 11g java.lang.UnsatisfiedLinkError

I hit this error recently while trying to send an EDI data through my B2B gateway and lost my way as couple of re-installs from scratch didn't really helped either. All the help from different forums and blogs pointed basically to 4 causes for this error as cited below; Note that my environment is Windows 7 64-bit with SOA 11.1.1.5 (latest as on the date of writing).

1. Installing 32-bit installables of SOA suite/WebLogic on a 64-bit environment
2. Installed 64-bit installables of SOA/WebLogic on a 32-bit JDK
3. Corrupt Edifecs or XEngine files
4. Permissions issue on the XEngine folder/libraries

If your case falls in one of the aforesaid cases, then don't read further as you will have to rectify them which could well solve the issue in first place.

In my case, neither of the above were the actual causes as I got my environments and installs perfectly having done several middleware product installs on various environments myself !!! However, this error simply defied all logic and intuition. Detailed error message below;

<Error> <oracle.soa.b2b.engine> <BEA-000000> <java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStreamNative(Ljava/lang/String;Ljava/io/InputStream;)Lcom/edifecs/xengine/xeobjects/XESource;       
        at com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStreamNative(Native Method)
        at com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStream(Unknown Source)
........................................
........................................
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:234)
        at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
        at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
        at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
>

Then I started my traditional Google search in a slightly different fashion trying to identify the generic root cause of this exception. After all this is a JAVA error which is reported during the EDI processing by the B2B gateway.

At this juncture it would be good to understand the cause for "java.lang.UnsatisfiedLinkError"; As per Java Docs this error is "Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native". Now, this much of help is great to identify and resolve the issue (at least in this particular case ;)

As a matter of fact, XEngine library files are located in <MiddlewareHome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin. I also noticed the following message in the WebLogic console during my server startup which explained the rest.

XEngine may not be installed properly. If you plan to use EDI/HL7 that requires XEngine, please unzip the XEngine bundle to install XEngine manually in $ORACLE_HOME/soa/thirdparty/edifecs directory

Yes, the library files are intact and are present in the specified location (uncorrupted !). It is just that WebLogic could not load the XEngine libraries. Now, there is one way to explicitly make WebLogic load these libraries;

If you are on Windows, set -Djava.library.path=<MiddlewareHome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin
On Linux, set LD_LIBRARY_PATH=<MiddlewareHome>/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin

Doing this explicitly in setSOADomainEnv.cmd or setSOADomainEnv.sh will ensure that WebLogic loads these libraries during server startup and voila we got rid of the spunky error.

Ah.. Finally do let me know if this helped you :)

Sunday, February 12, 2012

SOA 11g DB Sequence Reset Issue

Ever wondered why the primary key sequence is reset while using a DB adapter to insert records from your SOA application?

The issue is that the DB adapter pre-allocates sequence values based on the value configured in the DB Adapter's outbound connection pool.

To overcome this issue, ensure that the "sequencePreallocationSize" property value matches the value that was specified for sequence increment in DB during sequence creation. For example 1.


BPM 11g BAM Data Object not created automagically

Have you ever faced a situation where the BAM DO was not getting created automagically when you deploy and run your BPM 11g (In this case I am using BPM 11.1.1.5 with FP) process as expected? Here are the list of checks that you must make to ensure that everything was setup as documented.

1. Ensure that the BAM deployment configurations are done in Oracle WebLogic Console (Go to Deployments -> BAM Adapter -> Configurations -> Outbound Connection Pool and provide the BAM connection details for eis/bam/soap and update the deployment plan)

2. Go to Oracle WebLogic EM console, ensure that the 'Disable Actions' property is empty (By default, this property will hold a value as 'BAMCommand') under the soa-infra domain 'System MBean Browser'

3. Ensure that the 'Enable BAM' option is selected. Go to 'BPM Project Navigator', right click on the process -> Project Preferences -> Select 'Enable BAM' option. Also ensure that the BAM Adapter JNDI is provided as configured in the deployments (refer step 1 above). By default the JNDI is eis/bam/soap. Leave the Data Object location to Samples/Monitor Express which would the default location where the BAM DO will be created 'automagically'


4. Ensure at least one business indicator (dimension) must have been created in the BPM process for which you would ideally pass/set values from within multiple stages in your process so that the runtime data is sent to BAM real-time

5. Before deploying the BPM process (after enabling BAM), ensure that any previous versions of the process are undeployed from Oracle WebLogic server

6. DO NOT execute the setup.bat or setup.sh script available under /Oracle_SOA1/bam/samples/bam/monitorexpress/bin

I have noticed that this had caused the following error while BAM tries to create the data object dynamically (version 11.1.1.5 with FP). On closer observation of the bam server diagnostic logs the following error is sighted which in itself is not very intuitive to fix as it complains of constraint violation in orabam MDS database during the creation of the BPM BAM DO.

Exception: oracle.bam.adc.common.exceptions.UniqueConstraintViolationException: BAM-01273: Active Data Cache unique constraint violation
  at oracle.bam.adc.dse.oracle.OracleExceptionHelpers.getStorageException(OracleExceptionHelpers.java:134)
  at oracle.bam.adc.dse.oracle.OracleStorageEngine.insertDataSetRow(OracleStorageEngine.java:1216)
  at oracle.bam.adc.kernel.datasets.DatasetBase.insertRowInternal(DatasetBase.java:630)
  at oracle.bam.adc.kernel.datasets.DatasetBase.insertRow(DatasetBase.java:592)
  at oracle.bam.adc.kernel.datasets.SystemDataset.insertRowInternal(SystemDataset.java:172)
..
..
..
Caused by: java.sql.SQLIntegrityConstraintViolationException: SQLError(1) SQLState(23000) ORA-00001: unique constraint (DEV_ORABAM.SYS_C007296) violated

In order to fix this issue, do the following;
Go to BAM console -> Active Studio -> Delete the following reports pertaining to BAM monitor express
  • Monitor Express Dashboard
  • Monitor Express Summary
  • Monitor Process Details
  • Fault Report

Go to BAM Console -> Architect -> Delete the following Data Objects pertaining to BAM monitor express in the order specified below;
  • INTERVAL
  • COUNTER
  • COMPONENT

7. Undeploy existing process composite if any

8. Restart your servers

9. Deploy the BPM process

10. Trigger an instance. Voila!! the BAM Data Object should have got created in your BAM console

11. Now, play around with the BAM DO and build your custom real-time dashboard reports