Now when I try to take snapshot using the command java -jar jboss-profiler-client.jar snapshot, the command prompt never returns.
The snapshot command can take a while to complete - also try to increase the heap size for the VM using -Xmx1024m.
It sounds like you are doing it the right way.
You may want to try the Save command followed by the GetSnapshot command instead.
Otherwise post your full config here together with the commands executed.
I tried running the jboss-profiler-client.jar on a remote machine ( different from where JBoss AS is running) by executing the following command
java -Xmx1024m -jar jboss-profiler-client.jar -h <IP Address> -p 5400 snapshot
Still the command prompt hangs (waited for around 30 minutes).
Even using listSnapshots doesn't display any output. jboss-profiler.properties copied to <JBOSS_HOME>/bin is provided below:
If stopProfiler or snapshot doesn't return, try to set "jsf=no" in jboss-profiler.properties.
I had this problem, and eventually I've found out that the jsf profiler tryes to validate XML documents at some point during the stopProfiler call, and it needs to access external web sites to do so. Our firewall was blocking outgoing requests, so all XML validation attempts had to wait until the connection timed out.