Agent reference

Contents / Java Edition / User Guide / Appendix / Agent reference

This chapter provides a quick reference to the MyARM agent bindings and describes possible error codes and log messages.

Java Language Binding

Error return codes

The following error codes apply only to the MyARM Java agent. Additionally error codes from the MyARM C agent can be returned from the Java agent since MyARM Java agent is JNI based. This is indicated by an JNI error: prefix.

MYARM_ERROR_NONE (0)
This is not really an error code; it indicates that the operation succeeded successfully.
MYARM_ERROR_NO_MEMORY (-1)
MyARM tried to allocate some memory but this failed.
MYARM_ERROR_NO_TRAN_DEF (-6)
An ArmTransaction, ArmTranReport or an ArmTransactionWithMetrics was created with a null ArmTransactionDefinition instance.
MYARM_ERROR_NO_APP_DEF (-11)
An ArmTransactionDefinition or an ArmMetricDefinition was created with a null ArmApplicationDefinition instance.
MYARM_ERROR_NO_NAME (-13)
Either creating an ArmApplicationDefinition, ArmTransactionDefinition or an ArmMetricDefinition the mandatory name was not provided (null pointer).
MYARM_ERROR_INVALID_METRIC_FORMAT (-14)
The ArmMetric and ArmMetricDefinition does not match or is unknown.
MYARM_ERROR_NO_ARRAY (-18)
A null byte array was passed to the constructor of ArmID or to the setBytes() of ArmToken.
MYARM_ERROR_NO_APP (-19)
A null application instance was passed to the constructor of ArmTranReport, ArmTransaction or ArmTransactionWithMetrics.
MYARM_ERROR_INVALID_LENGTH (-20)
A null application instance was passed to the constructor of ArmTranReport, ArmTransaction or ArmTransactionWithMetrics.
MYARM_ERROR_INVALID_INDEX (-21)
Context values and metrics are managed as arrays within the MyARM agent. An index passed to MyARM was out of bounds.
MYARM_ERROR_ALIEN_OBJECT (-22)
Attempt to use an object from a different ARM implementation. This mostly fails because this implementation relies on opaque characteristics of its own implementation objects. Object-level interoperability with other ARM implementations is not provided here.
MYARM_ERROR_LIMIT_REACHED (-23)
MyARM tried to get a resource but the limit for the resource (transaction instance or metric instance) was reached.
MYARM_ERROR_JNI_INVALID_ARG (-30)
Within the Java JNI code an invaid argument was detected. Please report this error code to the MyARM support.
MYARM_ERROR_JNI_CLASS_NOT_FOUND (-31)
Within the Java JNI code a required MyARM java class could not be found. Please make sure you provided the current myarm.jar to the JVM. If the myarm.jar and MyARM C agent are from the same version please report this error code to the MyARM support.

Creating ARM 4.0 objects

The Java language binding standard defines a vendor independent way for creating ARM objects. Within ARM 4.0 there are three factory classes a ARM implementation has to provide. The class names of these factory classes are provided by the Java property concept. To use MyARM ARM 4.0 java agent please use the following factory class names:

Arm40.ArmTransactionFactory
com.myarm.arm40.ArmTransactionFactoryImpl
Arm40.ArmTranReportFactory
com.myarm.arm40.ArmTranReportFactoryImpl
Arm40.ArmMetricFactory
com.myarm.arm40.ArmMetricFactoryImpl

MyARM ARM 4.0 jar file

Once you configured the MyARM specific factory names you need to provide the MyARM implementation classes to the java virtual machine. This is done by appending the MyARM JAR (myarm.jar) archive to the CLASSPATH environment variable.

export CLASSPATH=$CLASSPATH:$MYARM_ROOT/lib/jar/myarm.jar