- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Java Application analysis MAC os

I m trying to configure one java app to use appdynamics monitoring. I started my app like
java -javaagent:~/GATEWAY_HOME/AppServerAgent/javaagent.jar=1fztenzglzcr=Node 0950 ~/GATEWAY_HOME/bin/gateway.start
But getting the below error
java -javaagent:/Users/xxx/GATEWAY_HOME/AppDynamics/javaagent.jar=1fztenzglzcr=Node 0950
objc[650]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Install Directory resolved to[/Users/xxx/GATEWAY_HOME/AppDynamics]
Unidentified -javaagent argument: 1fztenzglzcr=Node
[INFO]: AgentInstallManager - AppDynamics Agent edition [standard]
[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver is running
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using application name [Kaazing Test]
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using tier name [tier]
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using node name [Node 0950]
[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver finished running
[INFO]: AgentInstallManager - Agent runtime directory set to [/Users/xxx/GATEWAY_HOME/AppDynamics]
[INFO]: AgentInstallManager - Agent node directory set to [Node 0950]
[WARN]: AgentInstallManager - Invalid Edition [Java Agent]. Keeping current edition [STANDARD]
[INFO]: JavaAgent - Using Java Agent Version [Server Agent v3.9.1.0 GA #2014-08-11_16-14-01 r7a933c56e7fcff08b339b3db3cec2cd05589da82 16-3.9.1.next]
[INFO]: JavaAgent - Running IBM Java Agent [Yes]
[INFO]: JavaAgent - Java Agent Directory [/Users/xxx/GATEWAY_HOME/AppDynamics]
Agent Logging Directory [/Users/xxx/GATEWAY_HOME/AppDynamics/logs/Node 0950]
Running obfuscated agent
Registered app server agent with Node ID[1111] Component ID[1090] Application ID [675]
Started AppDynamics Java Agent Successfully.
Error: Could not find or load main class 0950
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We see the error is due to space in node name where JVM is considering that 0950 as main class here and later parameters as args for 0950 class , we request you to restart the jvm either as follows:
shell> java -javaagent:~/GATEWAY_HOME/AppServerAgent/javaagent.jar=1fztenzglzcr=Node_0950 ~/GATEWAY_HOME/bin/gateway.start
Or
shell> java -javaagent:"~/GATEWAY_HOME/AppServerAgent/javaagent.jar=1fztenzglzcr=Node 0950" ~/GATEWAY_HOME/bin/gateway.start
That should resolve the error.
Regards,
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Arun,
Many thanks for your answer.
But, either of the shared resolution did not worked for me, can you please check if i am doing something not recommended.
I assume i dont have to change anything in controller-info.xml. Please suggest.
* java -javaagent:/Users/xxx/GATEWAY_HOME/AppDynamics/javaagent.jar=1fztenzglzcr=Node_0950 /Users/xxx/GATEWAY_HOME/bin/gateway.start
* java -javaagent:"/Users/xxx/GATEWAY_HOME/AppDynamics/javaagent.jar=1fztenzglzcr=Node 0950" /Users/xxx/GATEWAY_HOME/bin/gateway.start
Error stack below,
objc[3920]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Install Directory resolved to[/Users/xxx/GATEWAY_HOME/AppDynamics]
Unidentified -javaagent argument: 1fztenzglzcr=Node 0950
[INFO]: AgentInstallManager - AppDynamics Agent edition [standard]
[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver is running
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using application name [Kaazing Test]
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using tier name [tier]
[INFO]: AgentInstallManager - Full Agent Registration Info Resolver using node name [Node 0950]
[DEBUG]: AgentInstallManager - Full Agent Registration Info Resolver finished running
[INFO]: AgentInstallManager - Agent runtime directory set to [/Users/xxx/GATEWAY_HOME/AppDynamics]
[INFO]: AgentInstallManager - Agent node directory set to [Node 0950]
[WARN]: AgentInstallManager - Invalid Edition [Java Agent]. Keeping current edition [STANDARD]
[INFO]: JavaAgent - Using Java Agent Version [Server Agent v3.9.1.0 GA #2014-08-11_16-14-01 r7a933c56e7fcff08b339b3db3cec2cd05589da82 16-3.9.1.next]
[INFO]: JavaAgent - Running IBM Java Agent [Yes]
[INFO]: JavaAgent - Java Agent Directory [/Users/xxx/GATEWAY_HOME/AppDynamics]
Agent Logging Directory [/Users/xxx/GATEWAY_HOME/AppDynamics/logs/Node 0950]
Running obfuscated agent
Registered app server agent with Node ID[1401] Component ID[1090] Application ID [675]
Started AppDynamics Java Agent Successfully.
Error: Could not find or load main class .Users.xxx.GATEWAY_HOME.bin.gateway.start
* I installed, machine agent as well. But bit confused do we have to have both agents or either will work. For example, JVM will track of only Java applications running on my system. What about other applications or technologies that are not Java/.net/PHP base apps. Like javascript frontend, Erlang logical server or database.Please suugest.
Regards
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The provided suggestions assumes that there is main class defined in /Users/xxx/GATEWAY_HOME/bin/gateway.start java program compiled class, Can you check whether java program startes fine when issued the command listed below:
shell> java /Users/xxx/GATEWAY_HOME/bin/gateway.start
Above said is evident from below error message "Error: Could not find or load main class .Users.xxx.GATEWAY_HOME.bin.gateway.start" it means gateway.start is not a valid class with main method.
Can you also try running the java -javaagent command from directory where java main class exists to avoid any path syntax issues here that will result in missing classpath case here ?
We request you to go through the following docs links: http://docs.appdynamics.com/display/PRO39/AppDynamics+Application+Intelligence+Platform
http://docs.appdynamics.com/display/PRO39/Supported+Environments+and+Versions+for+.NET
http://docs.appdynamics.com/display/PRO39/Supported+Environments+and+Versions+for+PHP
and you might need to install .net and php agent as referred in other forum query , refer steps to install other agents
http://docs.appdynamics.com/display/PRO39/Install+the+PHP+Agent
Regarding your query on machine agent , we confirm java agent is to monitor JVM and BT requests, where as machine agent is to monitor h/w metrics like CPU, memory , disk i/o etc. Installing machine agent is optional until unless you want machine agent metrics.
Hope that answers all your queries.
Regards,
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Arun,
I tried to run the application from shell as suggested like,
shell> java /Users/xxx/GATEWAY_HOME/bin/gateway.start
but did not worked. However, if i try to start the same without java
shell> /Users/xxx/GATEWAY_HOME/bin/gateway.start all worked well.
Please suggest.
Also, the same did not worked if i do try to start the application from root as suggested.
Regards
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It could be the case that gateway.start is not a java program and might be a script file which internall invokes a java program in the file, We might need to add -javaagent:<agent_dir>/javaagent.jar entry after java command in this script file.
Can you attached gateway.start script for our review , we would like to see how this script file is calling java program ?
Regards,
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Arun,
Please find the attached file enclosed with the message [CHANGED TO TXT].
Also i am using HotSpot JVM[is there any need to add something to that.if yes, please tell me how]. I am running the command from shell otherwise.
Thanks for your help.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We see the script is calling the followig code line:
java $GATEWAY_OPTS -Djava.library.path="$JAVA_LIBRARY_PATH" -XX:+HeapDumpOnOutOfMemoryError -cp "$CP" com.kaazing.gateway.server.Main $*
Can you update the above line as follows:
java -javaagent:"/Users/xxx/GATEWAY_HOME/AppDynamics/javaagent.jar" $GATEWAY_OPTS -Djava.library.path="$JAVA_LIBRARY_PATH" -XX:+HeapDumpOnOutOfMemoryError -cp "$CP" com.kaazing.gateway.server.Main $*
and see how it goes. Also from code snippet it seems you are using Main progream unlike application servers like tomcat, jboss where ootb entry points like servlet, struts are discovered automatically.
We request you to define custom pojo rules from Configure -> Instrumentation -> Transaction detection screen under custom rules section on target API class/method details which you want to monitor as BT , if no BT auto discovered under BT grid screen in Controller UI.
Hope that information helps.
Regards,
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Arun,
That worked like charm...thanks.
One more question though, as you said we have to set ActiveMQ as remote service to be detected automatically. That means we dont have to set any agent for that java application. As soon as there is transaction and if rules match, we will be able to see data in appdynamics. Please suggest. Meanwhile i have attached the startup script for the same as well.
Regards
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to hear that news from you. Regarding latest query , Yes you are right, if BT (class/method) part of discovered BT/snapshots that makes calls to activemq you will see automatically discovered remote service which shows calls, ART etc metrics as shows for other backend.
If you want to monitor JVM stats of the activemq jvm than we request you to start activemq as follows:
shell> cd <activemq_install_dir>/bin
shell> java -javaagent:<agent_dir>/javaagent.jar -jar run.jar start
Or you can pass -javaagent arg in line, Hope that information helps.
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar
updated as follows:
-javagaent:<agent_dir>/javaagent.jar -jar \"${ACTIVEMQ_HOME}/bin/activemq.jar
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Arun,
I tried to use the command that you shared and replaced but activeMQ did not started with the agent. However, when i replaced the same in "stop" loop, it worked well but as the command is running to stop the server, server gets stopped before after running the agent command successfully. I have attached the start up script. Please suggest.
Replacement done on line
404, 418 & 430
Many Thanks.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
See starting activemq as follows helps:
java -javaagent:<agent_dir>/javaagent.jar -jar run.jar start
Regards,
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
I meant to add -javaagent arg in shell console as shown below , please ignore the changes in sh file, just see if starting as shown below works, as it worked for us fine and it should work too, if you see error send the error from console
Regards.
Arun
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

But which run.jar you are referring here in the command, as i can not find
any specific to ActiveMQ. Please suggest.
Many Thanks
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
run.jar is inside <activemq_install_dir>/bin path hope that clarifies
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I think the version you are having "5.2" does have that, as the one i have
installed as "5.10" does not have that. Instead, it has activemq.jar with
which i tried to run like,
java -javaagent:"/Users/amit/AppServerAgent/javaagent.jar" -jar
"/Users/amit/ACTIVEMQ_HOME/bin/activemq.jar"
it starts the Javaagent only but not activemq.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please try as shown below, i just installed and tried same version now:
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

It worked. Thanks a lot.
