Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jms client

ranga shreya
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have an assignment to write a jms client code. Sending an message from a servlet to a queue. getting the messages from the queue through messagedrivenbean.My question is Iam not abel to put the message through the servelt what might be the reason.
this is my code..
Context jndiContext = null;
ConnectionFactory connectionFactory = null;

Destination dest = null;
//ConnectionFactory connectionFactory = null;

try {
connectionFactory = (ConnectionFactory)
dest = (Destination) jndiContext.lookup("emailJmsQueue");
Connection connection =
Session session = connection.createSession(false,
MessageProducer producer = session.createProducer(dest);
TextMessage message = session.createTextMessage();
message.setText("This is message 1" );
System.out.println("Sending message: " +message.getText());

catch (Exception e) {
System.out.println("JNDI API lookup failed: " +
Evil is afoot. But this tiny ad is just an ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!