wood burning stoves*
The moose likes Websphere and the fly likes Help need with JMS Listener in WSAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Help need with JMS Listener in WSAD" Watch "Help need with JMS Listener in WSAD" New topic
Author

Help need with JMS Listener in WSAD

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Hi �
I�m trying to activate the pre-configured JMS Listener in WSADIE 5 with a JSP.
I coded the Sample: �Creating a JMS enterprise service from a Java class (JMS service)� which uses the stock quote example and it works fine with the Session Bean client.
Now I want to invoke the MDB with a JSP but the MDB does not get invoked:
It appears to write to the queue but I the MDB does not get invoked:
Note: If I uncomment the qSession.commit(), I get a transactional error:
MQJMS1019: invalid operation for non-transacted session
JSP code:
QueueConnectionFactory qcf = (QueueConnectionFactory) env.lookup("jms/QCF");
QueueConnection qc = qcf.createQueueConnection();
out.println("
jms/QCF "+" found");
QueueSession qSession = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
//Queue q = (Queue) env.lookup("jms/receiverQ");
//out.println("
jms/receiverQ "+" found");
Queue q = (Queue) env.lookup("jms/senderQ");
out.println("
jms/senderQ "+" found");

QueueSender sender = qSession.createSender(q);
TextMessage msg = qSession.createTextMessage();
msg.setText("bla bla bla");
sender.send(msg);
//qSession.commit();
out.println("
msg sent");
Matthias Hein
Greenhorn

Joined: Jun 22, 2005
Posts: 1
Hi Max,
have you ever found a solution to this problem?
I ran into the same message MQJMS1019 trying to do a queueSession.commit().
I have thread A sending messages into the queue and thread B retrieving those messages. Problem is, that without the commit() thread B only starts getting messages after thread A disconnects.
Both threads run within WAS 5.1 EJB-Containers.


Originally posted by Max Tomlinson:
Hi �
I�m trying to activate the pre-configured JMS Listener in WSADIE 5 with a JSP.

I coded the Sample: �Creating a JMS enterprise service from a Java class (JMS service)� which uses the stock quote example and it works fine with the Session Bean client.

Now I want to invoke the MDB with a JSP but the MDB does not get invoked:

It appears to write to the queue but I the MDB does not get invoked:

Note: If I uncomment the qSession.commit(), I get a transactional error:

MQJMS1019: invalid operation for non-transacted session

JSP code:

QueueConnectionFactory qcf = (QueueConnectionFactory) env.lookup("jms/QCF");
QueueConnection qc = qcf.createQueueConnection();
out.println("
jms/QCF "+" found");
QueueSession qSession = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
//Queue q = (Queue) env.lookup("jms/receiverQ");
//out.println("
jms/receiverQ "+" found");
Queue q = (Queue) env.lookup("jms/senderQ");
out.println("
jms/senderQ "+" found");

QueueSender sender = qSession.createSender(q);

TextMessage msg = qSession.createTextMessage();
msg.setText("bla bla bla");
sender.send(msg);
//qSession.commit();
out.println("
msg sent");
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
Hi,
Do true in the following code



Viki


Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help need with JMS Listener in WSAD