Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jms client  RSS feed

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: " +
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!