Does it work?
I think
you should use JNDI to lookup a ConnectionFactory instead of new one by yourself.
Some information from javax.jms.ConnectionFactory
"Although the interfaces for administered objects do not explicitly depend on the
Java Naming and Directory Interface (JNDI) API, the JMS API establishes the convention that JMS clients find administered objects by looking them up in a JNDI namespace.
"