• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Queue Connection Factory in WAS

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic