How to create a platform independent JRE Grid Library

How to create a platform independent JRE Grid Library

book

Article ID: KB0090709

calendar_today

Updated On:

Products Versions
TIBCO DataSynapse GridServer -
Not Applicable -

Description

Resolution:
Knowledge base article 240 explains how to create a basic JRE Grid Library but that specific case does not always work if you are trying to use the same version JRE GridLibrary for multiple platforms in the same application. In that case you may receive a java.lang.UnsupportedClassVersionError exception. Here is an example of how to use the same JDK version grid library for 32 bit Linux and Windows.

1) Locate a functional installation of the target JDK version for each target platform. (These can also be downloaded from the optional engine JRE section under GridServer Releases on http://customer.datasynapse.com)

2) Ensure that the US Export Sun JCE package is properly installed in the target JDK. Typically this means updating the files US_export_policy.jar and local_policy.jar in the jre/lib/security directory under the JDK install directory.

3) Create a grid-library.xml file with the following contents:

For Linux:

<?xml version="1.0" encoding="UTF-8"?> &ltgrid-library jre="true" os="linux"> &ltgrid-library-name&gtjre-linux</grid-library-name> &ltgrid-library-version&gt1.5.0.10</grid-library-version> &ltlib-path> &ltpathelement>./jre/lib/ext</pathelement> &ltpathelement>./jre/lib/i386</pathelement> &ltpathelement>./jre/lib/i386/server/</pathelement> &ltpathelement>./jre/bin</pathelement> &ltpathelement>./jre/lib/i386/native_threads/</pathelement> </lib-path> </grid-library>

For Windows:

<?xml version="1.0" encoding="UTF-8"?> &ltgrid-library jre="true" os="win32"> &ltgrid-library-name&gtjre-win32</grid-library-name> &ltgrid-library-version&gt1.5.0.10</grid-library-version> &ltlib-path> &ltpathelement&gtjre/bin</pathelement> &ltpathelement&gtjre/bin/server</pathelement> &ltpathelement&gtjre/lib</pathelement> &ltpathelement&gtjre/lib/ext</pathelement> </lib-path> </grid-library>

4) Create the Grid Library for each platform containing the grid-library.xml that you created above and the JRE you wish to use. An example of the directory listing in the top level of the archive would look like this:

grid-library.xml <- file
jre <- directory

5) Name the Grid Library for each appropriate platform. Example: 1.5.0.10-linux.tar.gz for Linux 1.5.0.10-win32.zip for Windows 6) Add the following dependences to your application:

&ltdependency>
  &ltgrid-library-name&gtjre-win32</grid-library-name>                  
  &ltgrid-library-version&gt1.5.0.10</grid-library-version>
       </dependency>
&ltdependency>
   &ltgrid-library-name&gtjre-linux</grid-library-name>                  
   &ltgrid-library-version&gt1.5.0.10</grid-library-version>
</dependency>

After performing these steps your application will use the exact JRE version that you have specified for each platform.

Issue/Introduction

How to create a platform independent JRE Grid Library