You are writing an EE component that functions as a message producer. The message producer sends message to a JMS queue. The component environment defines a resource-ref of type javax.jms.ConnectionFactory with the same jms/ConnectionFactory. Which will correctly obtain a connection factory for a queue?
Context context = new initialContext();Connectionfactory confac = (ConnectionFactory) Context.lookup("java: comp/env/jms/ConnectionFactory");