Debugging with JSAMP

JSAMP provides many facilities which are useful for the application author when adding SAMP capabilities to new or existing applications, or when testing SAMP communications between tools and trying to see what is or isn't working. In many cases this applies whether or not you are using JSAMP for your own SAMP implementation.

Here is a short summary of some of the most useful of these facilities. It is not exhaustive.


JSAMP's GUI hub view represents pretty much the entire state of the hub in graphical terms, including all the messages which are passing through and their responses. If you start the JSAMP hub

   java -jar jsamp.jar hub -mode msg-gui

then you can see all the messages, including their text and any errors and so on in the responses. See the GUI section for examples.

You can get a similar view from a client's-eye view using the HubMonitor in GUI/message tracker mode to view a third party hub, though it doesn't have access to as much information as the Hub GUI itself (it can only see the messages it participates in itself).

Low level message logging

You can see all the details of of the XML-RPC exchanges between SAMP clients if you set the jsamp.xmlrpc.impl system property appropriately on one of the clients or the hub or both (but note the output can get quite verbose). This is good for diagnosing bad XML-RPC sends/receives, and also for getting concrete examples of what the POSTed XML text looks like if you are constructing your own messages by hand.

When using the Web Profile, running the hub with one of the -web:log options can be very helpful, since it shows all of the traffic to and from the Hub Web Profile HTTP server.

Custom message sends

If your application is waiting for messages with a given MType, but you don't have another one to hand which can generate such messages, you can use the MessageSender tool to generate messages to order and send them from the command line.

Custom message receives

Conversely, if your client is sending messages but you don't have a recipient for them, you can run Snooper subscribed to the MType(s) in question to receive the messages and see what they look like.