How to add native libraries to the front of the BE java library path

How to add native libraries to the front of the BE java library path

book

Article ID: KB0072988

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 6.0 and later

Description

In some cases, it may be required to place required 3rd party native libraries at the front of the BE application's Java library path. This can avoid errors that occur when the incorrect version of the native library is selected, given the current BE environment configuration. For example..
<tims_stamp> com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll cause : C:\Windows\System32\sqljdbc_auth.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

Issue/Introduction

Outlines the steps needed to ensure 3rd party native libraries are referenced at the front of the Java library path.

Resolution

The above failure is due to the BE application attempting to use the 32-bit version of sqljdbc_auth.dll instead of the 64-bit version. The warning message reveals that the incorrect 32-bit DLL is being loaded from the Windows System32 folder.

To see the Java library path for a running BE application, you may inspect the jinfo output, as noted in KB article 000044731. For example..
java.library.path=C\:\\tibco\\tibcojre64\\11\\bin;C\:\\WINDOWS\\Sun\\Java\\bin;C\:\\WINDOWS\\system32;C\:\\WINDOWS;
c\:/tibco/be/6.0/hotfix/bin;c\:/tibco/be/6.0/bin;c\:/tibco/as/2.4/lib;/lib;/bin;/lib;/bin;.
Here, we can see that the tibcojre64 bin directory is referenced at the very front of the Java library path, and the Windows System32 directory is referenced further down in the path. So in this case, you may copy the correct 64-bit version of sqljdbc_auth.dll to the tibco jre's bin directory (C:\tibco\tibcojre64\11\bin\). This will ensure that the 64-bit version gets picked up by the BE jvm before the 32-bit version.