How does a Java agent get the application names deployed on Tomcat

Discussion created by yogesh.belsare on Mar 20, 2012
Latest reply on May 7, 2012 by yogesh.belsare
Hi All ,

How does a Java Agent get the application names that are deployed on Tomcat . For Ex when you deploy a applications called as TestApp in the webapps directory , you see the application name
in the investigator tree as "TestApp" . From where is this name picked up ? or rather how does the java agent become aware of the deployed applications .
I am asking this question because we are asked to deploy CA Introscope on a application that uses Tomcat in a very unusual manner . The Tomcat server is started from the code itself ( i think using the Tomcat
bootstrap class) i.e they start the application as java -jar biz.jar . The biz.zar contains the code where the tomcat server is started . Somewhere in their deployment directory structure is a webapps folder and i can see the applications in that folder .
They do not use the catalina.sh and so we cannot modify it to start the agent along with the tomcat server . I am assuming we can start the Agent along with their application using the
set WILY_ARGS=-javaagent:"%WILY_HOME%\Agent.jar"
set WILY_NAME=-Dcom.wily.introscope.agent.agentName=NewTomcatAgent
set WILY_OPTS=-Dcom.wily.introscope.agentProfile="%WILY_HOME%\IntroscopeAgent.profile" %WILY_NAME%

java %WILY_ARGS% %WILY_OPTS% -jar biz.jar

but am not sure if the java agent will pick up the deployed applications .

Any help is appreciated , do let me know if any more clarification is required .