publishing and reading from jms simple java class for reading and writing to weblogic jms. import java.net.URL; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueReceiver; import javax.jms.QueueSession; import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.Context; import javax.naming.InitialContext; import org.apache.axis.AxisFault; public class ReadFromRemoteJms{ public static void main(String args[]) { try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, “weblogic.jndi.WLInitialContextFactory”); env.put(Context.SECURITY_PRINCIPAL, “weblogicusername”); env.put(Context.SECURITY_CREDENTIALS, “weblogicpassword”); env.put(Context.PROVIDER_URL, “t3://ipaddress:7711”); InitialContext context = new InitialContext(env); QueueConnectionFactory connFactory = (QueueConnectionFactory) context.lookup(“jms/QueueConnectionFactory”); QueueConnection conn = connFactory.createQueueConnection(); QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue q = (Queue) context.lookup(“jms/XboxEventQueue”); QueueReceiver receiver = session.createReceiver(q); conn.start(); ObjectMessage m = (ObjectMessage) receiver.receive(); SomeObjectYouPutIntoJms e = (SomeObjectYouPutIntoJms) m.getObject(); System.out.println(“Message Received: ” + e.getMsisdn()); session.close(); conn.close(); } catch (Exception ex) { ex.printStackTrace(); } } }