To enable the Java™ virtualization
agent to capture Java method
calls being used by a Java application,
the agent must be loaded into the application's Java virtual machine (JVM). To load the agent
into the application's JVM, modify the startup parameters of the application.
About this task
The
greenhat.javaagent.jar and
greenhat.javaagent.linkage.jar files
in
<Rational Integration Tester Platform Pack installation
directory>\JavaVirtualization\agent must always be colocated.
Otherwise, the Java virtualization
agent will not work correctly.
Note: The registration.xml file
in <Rational Integration Tester Platform Pack installation
directory>\JavaVirtualization\agent does not have to
be colocated with the JAR files, but by default, it is assumed that
the file is colocated with the JAR files. If you want to put the registration.xml file
in a different location, you will need to specify the path to the
file when installing the Java virtualization
agent into a Java application.
Procedure
- Edit the invocation command line or define a system environment
property to specify the location of the Java virtualization
agent as follows:
@SET JAVA_AGENT=<Rational Integration Tester Platform Pack installation directory>\JavaVirtualization\agent\greenhat.javaagent.jar
- Edit the invocation command line to include the javaagent parameter
when launching the JVM as follows:
"%JAVA_HOME\bin\java" "-javaagent:%JAVA_AGENT%" –jar <Java application name>.jar
- If you want to use the Java virtualization agent with an
application server such as IBM® WebSphere® Application Server that
has a Java 2 Security Manager, the agent might not run and the application
server might fail to start unless you configure the Security Manager
correctly.
To configure a Java 2 Security Manager to
work with the Java virtualization agent, add a permission of the following
format to the
server.policy file:
grant codeBase "file:<Java virtualization agent installation path>/greenhat.javaagent.jar" {
permission java.security.AllPermission;
};
Note: If using WebSphere Application Server,
the server.policy file is located in ${was.install.root}/profiles/${appserver.name}/properties.
Results
Before you can capture any Java method
calls in the Recording Studio perspective, you must create a Java
method transport in IBM Rational® Integration Tester.