Sample code

I’m sure the answer to this is in the jms_provider_programmers_guide_6.1_sp1 documentation but I can’t find it.

My question, can the PTP sample run as a JMS client on a machine that doesn’t have WM Broker? It works when I run it on the machine where broker is installed.

I put all the jar files on the remote machine and it compiles ok but it seems to be looking for a broker on the localhost.

I believe the samples get their JMS connection information from the file. You should be able to update this file to point to the correct hostname where BrokerJMS is installed.

If the hostname is hardcoded in the sample then you would need to modify it to point to the correct place.


It finds the right host. The program throws a JMSException when trying to create the qcf. I’m not sure if ‘localhost’ means the machine I’m running the program from or the host where broker is installed.

javax.jms.JMSException: [BRM.10.4011] JMS: Unable to connect to Broker at “localhost:6849”: Connection refused

Maybe you could post the sample you are working with as an attachment to your post.

Your bindings file which is .bindings unless you are using a JNDI provider other than the file based one (which I believe the samples use Sun’s file base provider) must be re-done in order to point to the remote host. The command line tools for the broker handle this. The broker documentation covers how to reconfigure.