Thanks Ranjith and Jeff.
I made the changes in my run.sh file of the hornetq.
I modified it like this:
java $JVM_ARGS -classpath $CLASSPATH -Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote org.hornetq.integration.bootstrap.HornetQBootstrapServer $FILENAME
The JMXServiceURL is made to point to server ip and port.
service:jmx:rmi:///jndi/rmi://localhost:6789/jmxrmi
Now it worked fine.
Thanks for all your help guys.
Another way is to just use the HQ core api as Tim suggests....
ClientSessionFactory sf = ...... ClientSession coreSession = sf.createSession(false, false, false); final String queueName = "queue.exampleQueue"; coreSession.createQueue(queueName, queueName, true); coreSession.close();
this is from the EmbeddedExample