If you're not setting a unique client ID then the exception would be expected as only one client can be connected to the broker for any given client Id. If you fix your code such that each client app has it's own unique client Id then the problem should resolve itself. You can of course also set an exception listener on the Connection to get notified of errors.
There is no way to test the connection as it's waiting for you to either set a ClientId or start the connection in order to behave as a JMS client. The actual connection handshake doesn't happen until the start call or any call that would require a fully established connection such as createSession etc. You should code you application to respond to failures from connection start.
Oh and FYI, setting client ID after calling start will have no effect as it is only allowed prior to the start of the Connection.