Unpredictable order when loading JAR files which causes performance issues.

Unpredictable order when loading JAR files which causes performance issues.

book

Article ID: KB0092900

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
Since BW has no control over class loading in JVM, logging classes may be loaded from different JAR files on different machines. This could result in different log contents and performance differences.

Symptoms:

Some machines may load the "tpcl/5.8/lib/slf4j-simple-1.5.2.jar" ahead and use these implemented classes and functions. Others may load tpcl/5.8/lib/slf4j-log4j12-1.5.2.jar instead.


Cause:

Both slf4j-log4j12-1.5.2.jar and slf4j-simple-1.5.2.jar implement log functions and similar classes. slf4j-log4j12-1.5.2.jar implements the log function and log levels in a more complicated way. slf4j-simple-1.5.2.jar implements in a way that makes little information available at the log level.

Issue/Introduction

Unpredictable order when loading JAR files which causes performance issues.

Resolution

If "slf4j-log4j12-1.5.2.jar" is used, the performance may be better as it logs less content .

If "slf4j-simple-1.5.2.jar" is used, performance may decrease since more content is logged.

To improve performance on machines where slf4j-simple-1.5.2.jar is loaded first, put the full path of the two JARs at the start of "tibco.env.CUSTOM_EXT_PREPEND_CP", such as the following:


tibco.env.CUSTOM_EXT_PREPEND_CP=%TPCL_HOME%/lib/slf4j-log4j12-1.5.2.jar%PSP%%TPCL_HOME%/lib/slf4j-api-1.5.2.jar%PSP%


Note, that this prevents classes loaded from a different version of "slf4j api" JARs, which may cause errors such as, "java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log". In this case, "slf4j-log4j12-1.5.2.jar" would be forced to be loaded first and provides logging functions and better performance.