File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes Queue Connection Factory in WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Queue Connection Factory in WAS" Watch "Queue Connection Factory in WAS" New topic

Queue Connection Factory in WAS

Venkat Ammisetty
Ranch Hand

Joined: Nov 25, 2000
Posts: 42
I need your help in implementing JMS QueueConnectionFactory in WAS 4.0
The following is the part of code to implement JMS with QueueConnectionFactory.I am pasting code below.My actual application is to put all e-mails list in Queue and send them when ever my mail server is free.
Please let me know why I am getting this exception and educate me in this regard if I am wrong in any QueueConnection Names.
But i am getting the following Exception
javax.naming.NameNotFoundException: QueueConnectionFactory
Partial CODE:
<%@ page language="java" <br /> import="javax.naming.*,javax.jms.*,java.util.* " %>
<%<br /> String JNDI_FACTORY="";<br /> String JMS_FACTORY="QueueConnectionFactory";<br /> String queueName="A";<br /> try{<br /> QueueConnectionFactory qconFactory;<br /> QueueConnection qcon=null;<br /> QueueSession qsession;<br /> QueueSender qsender;<br /> Queue queue=null;<br /> TextMessage msg;<br /> ObjectMessage omsg;<br /> System.out.println("hello");<br /> out.println("before hash table");<br /> Hashtable env = new Hashtable();<br /> env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);<br /> env.put(Context.PROVIDER_URL, "iiop://localhost:900");<br /> InitialContext ic=new InitialContext(env);<br /> out.println("before jms lookup");<br /> qconFactory = (QueueConnectionFactory) ic.lookup(JMS_FACTORY);<br /> qcon=null;<br /> qcon = qconFactory.createQueueConnection();<br /> out.println("just for fun");<br /> qsession = qcon.createQueueSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);<br /> out.println("jndi lookup is successfull");<br /> <br /> <br /> queue = (Queue) ic.lookup(queueName);<br /> <br /> qsender = qsession.createSender(queue);<br /> omsg = qsession.createObjectMessage();<br /> qcon.start();<br /> Vector v=new Vector();<br /> v.addElement("venkat");<br /> omsg.setObject(v);<br /> qsender.send(omsg);<br /> qsender.close();<br /> qsession.close();<br /> qcon.close();<br /> System.out.println("vector is put in the queue");<br /> } catch (Exception ne) {<br /> <br /> out.println("wrong queue is"+ne);<br /> }<br /> <br /> %>


Venkat Ammisetty
subject: Queue Connection Factory in WAS
Similar Threads
weblogic 10 + JMS
Trying to write a jms client to receive as message
Resuse JMS Connection factory and jms Connection
problems with JMS communication between two weblogic servers running remotely
how to receive message from a queue