@@ -95,10 +95,10 @@ Google Compute Engine or on a virtual machine that does not allow API access to
9595all Google Cloud services. This would require setting up a
9696[ service account] ( #service-account ) .
9797
98- ### Web Servers
98+ ### Application Servers
9999
100- Java web servers usually start through a bootstrap process, and each web server
101- has its own way of customizing Java options.
100+ Java application servers usually start through a bootstrap process, and each
101+ application server has its own way of customizing Java options.
102102
103103#### Tomcat
104104
@@ -123,6 +123,29 @@ Add `cdbg.ini` file to `/var/lib/jetty/start.d`:
123123-agentpath:/opt/cdbg/cdbg_java_agent.so
124124```
125125
126+ ### Configuring Extra Classpath
127+ The agent needs to be able to find your application classes when it's running
128+ in an application server like Tomcat or Jetty. By default, the agent looks for
129+ the exploded root war directory. In other words, if you deployed a ` ROOT.war `
130+ in Tomcat, the agent can find it without additional configuration.
131+
132+ However, if you deployed your WAR file with a different name (e.g.,
133+ ` myapp.war ` ), or that the exploded WAR directory is not under the default
134+ exploded root war directory (e.g., your exploded war is under
135+ ` /opt/tomcat/webapps/myapp ` ), then you must
136+ let the agent know the full path to your application's classes using the
137+ ` cdbg_extra_class_path ` parameter.
138+
139+ ``` none
140+ -agentpath:/opt/cdbg/cdbg_java_agent.so=--cdbg_extra_class_path=/opt/tomcat/webapps/myapp/WEB-INF/classes
141+ ```
142+
143+ You can specify multiple paths by using a "` : ` " (colon) as the path delimiter.
144+
145+ ``` none
146+ -agentpath:/opt/cdbg/cdbg_java_agent.so=--cdbg_extra_class_path=/opt/tomcat/webapps/myapp/WEB-INF/classes:/another/path/with/classes
147+ ```
148+
126149### Naming and Versioning
127150
128151Developers can run multiple applications and versions at the same time within
0 commit comments