• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help need with JMS Listener in WSAD

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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");
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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");

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Do true in the following code



Viki
 
reply
    Bookmark Topic Watch Topic
  • New Topic