All Products
Search
Document Center

Data Transmission Service:Deploy a data collection environment

Last Updated:Mar 28, 2026

To analyze your Java applications for database migration, deploy a collector and configure a Java agent using Alibaba Cloud Advanced Database & Application Migration (ADAM). The collector receives call stack data from Java agents attached to your applications, which ADAM then uses to generate migration recommendations.

The deployment has two parts:

  1. Collector — a standalone service that receives data from Java agents

  2. Java agent — a lightweight component attached to your Java applications that sends call stack data to the collector

Complete both parts before collecting data.

Prerequisites

Before you begin, make sure that:

  • The collector server is dedicated — no online applications are running on it

  • JAVA_HOME is set and JDK 1.6 or later is installed on the collector server

  • (Method 1 only) The account used to start the Java agent matches the account used to start the application

Deploy the collector

Run the following command in the directory where the collector is installed.

Unix:

./run.sh

Windows:

start /b java -jar javaagent-collector.jar

Verify: Open collector/logs/collector.log. If the log contains startup or success, the collector is running.

If you encounter errors, see Application Collector FAQ.

Configure the Java agent

Step 1: Set up the environment

Make sure JAVA_HOME is configured. If JAVA_HOME is not configured, set the value of JAVA_HOME in the attach.sh file to the absolute path of JDK. If you use JRE instead of JDK, manually copy tools.jar to ${JAVA_HOME}/lib/.

Step 2: Edit javaagent.config

Set the required parameters:

ParameterDescriptionExample
profiler.collector.ipIP address of the collector11.23.45.67
profiler.collector.portCollector port9996
profiler.app.nameApplication name. Must be fewer than 20 characters and contain only letters and digits.adamApp
profiler.app.portApplication startup port. Configure one port per JVM regardless of the number of applications in the JVM.8080
profiler.applicationservertypeContainer type of the application middleware. Valid values: TOMCAT, JBOSS, WEBLOGIC.TOMCAT

Optional parameters:

ParameterDefaultDescription
profiler.classpath.whitelistPrefixes of directories containing the Java code to be tested. Separate multiple entries with commas. Each directory must have at least two subdirectory levels. Specify no more than five directories. If databases are changed, the collector uses precise call stack data from these directories to suggest application configuration updates. If you cannot specify directories here, configure filters on the ADAM console analysis page instead.
profiler.classpath.blacklistDenylist to filter out unnecessary call stack information. Can be omitted if the allowlist is set.
profiler.cpu.thresholdCPU utilization limit (%). Data collection pauses when this limit is reached. Example: 85
profiler.sys.send.interval15Interval (in minutes) for collecting system information.
profiler.sql.dynamic.send.interval15Interval (in minutes) for collecting dynamic SQL information.

Start the Java agent

Choose a startup method based on whether you can restart the application.

Choose your startup method

Method 1: Attach without restartMethod 2: Start with application (recommended)
When to useThe application has been running without a restart for a long time, and restarting it would affect your business.The application can be restarted, and you want continuous data collection without manual intervention.
How it startsManually attach the agent to the running process.Add the agent to the application startup script, then restart.
On each restartMust manually reattach the agent after every restart.Agent starts automatically with the application.
Account requirementThe account starting the agent must match the account that started the application.No account permission concerns.

Method 1: Attach without restarting

Add system operation permissions to the javaagent directory, then run the following command with ${pid} replaced by the process ID of the application.

Unix:

./attach.sh -p ${pid}

Windows:

java -cp "%JAVA_HOME%\lib\tools.jar;%cd%\javaagent-bootstrap.jar" com.alibaba.adam.javaagent.bootstrap.AgentAttacher -p ${pid}

Verify: Check the log file in the javaagent directory for a success message. If inbound traffic reaches the application and the collector directory contains a data subdirectory, the agent has started and is sending data.

Important

Make sure the process ID is correct and that the account starting the agent matches the account that started the application. If the application was started as a system user via Windows Registry, Method 1 will fail due to account permission differences — use Method 2 instead.

Method 2: Start with application (recommended)

Replace ${javaagent_path} with the actual path to the javaagent directory in the configuration file, then restart the application.

Unix

MiddlewareStartup fileConfiguration
Tomcatcatalina.shAdd to the last CATALINA_OPTS item: CATALINA_OPTS="$CATALINA_OPTS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
JBossrun.confAdd to the last JAVA_OPTS item: JAVA_OPTS="$JAVA_OPTS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
WebLogicstartWebLogic.shAdd to the last JAVA_OPTIONS item: JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
WebSphereConfig file (option 1)JAVA_OPTS="$JAVA_OPTS -javaagent:/home/admin/javaagent/javaagent-bootstrap.jar"
WebSphereCommon JVM parameters (option 2)name:javaagent value:/home/admin/javaagent/javaagent-bootstrap.jar
Docker containers in Kubernetes clustersDocker imagePlace the javaagent directory into the Docker image, add the corresponding config file, and deploy the image.

Windows

MiddlewareStartup fileConfiguration
Tomcatcatalina.batAdd to the last CATALINA_OPTS item: CATALINA_OPTS="$CATALINA_OPTS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
JBossrun.confAdd to the last JAVA_OPTS item: JAVA_OPTS="$JAVA_OPTS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
WebLogicstartWebLogic.cmdAdd to the last JAVA_OPTIONS item: JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:${javaagent_path}/javaagent-bootstrap.jar"
WebSphereSame as UnixSame as Unix

Verify: After the application starts, check the application logs for Java Agent load successfully!. If no agent information appears, the configuration path is invalid and the agent was not loaded. If an error occurs, update the script based on the error message.

Stop and resume monitoring

  • When the application stops: The agent stops regardless of which method was used.

  • Stop the agent:

    • Method 1: Run ./attach.sh -p ${pid} -s, or restart the application.

    • Method 2: Remove the -javaagent configuration from the startup script, then restart the application.

  • Resume monitoring after the agent stops: Restart the application.

    • Method 1: Manually start the agent after the application restarts.

    • Method 2: The agent starts automatically when the application restarts.

  • JBoss clusters: For both Community Edition and Enterprise Edition clusters, if the jboss.modules.system.pkgs configuration item exists, add com.alibaba.adam.javaagent to that item and restart the application before monitoring takes effect, regardless of which method you use.

Collect data

Run the collector for 1 to 7 days to gather sufficient data.

When ready to upload:

  1. Go to the data/ directory in the collector installation directory.

  2. Compress the collected files in ZIP format, organized by application name.

  3. Upload each application's ZIP file separately — one profile per application.

Packaging rules:

  • Data from different IP addresses for the same application can be combined into one ZIP file.

  • Data for different applications must not be combined into one ZIP file. Mixing applications causes an upload error.

What's next

Create an application profile