File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Queue Connection Factory in WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Queue Connection Factory in WAS" Watch "Queue Connection Factory in WAS" New topic
Author

Queue Connection Factory in WAS

Venkat Ammisetty
Ranch Hand

Joined: Nov 25, 2000
Posts: 42
hai
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="com.ibm.websphere.naming.WsnInitialContextFactory";<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 /> %>

Thank's
Venkat


Venkat Ammisetty
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Queue Connection Factory in WAS
 
Similar Threads
weblogic 10 + JMS
Resuse JMS Connection factory and jms Connection
how to receive message from a queue
problems with JMS communication between two weblogic servers running remotely
Trying to write a jms client to receive as message