ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Messaging driven bean listening for message on an MQQueue

Post new topic  Reply to topic
 Messaging driven bean listening for message on an MQQueue « View previous topic :: View next topic » 
Author Message
Vin
PostPosted: Sat Sep 27, 2003 9:24 pm    Post subject: Messaging driven bean listening for message on an MQQueue Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

I'm trying to deploy a Message Driven Bean listening for message to an MQSeries queue (local). I registered the MQQueueConnectionFactory and MQQueue in the JNDI namespace of weblogic and I gave the reference of the queue in the weblogic-ejb-jar.xml. The problem I'm having is that the message driven bean is not recieving any messages from the local MQSeries queue. Is there something that I'm doing wrong. Did anyone do this kind of an implementation before. Any help is appreciated
Back to top
View user's profile Send private message
Keka
PostPosted: Sun Sep 28, 2003 9:03 am    Post subject: Reply with quote

Voyager

Joined: 28 Dec 2002
Posts: 96

We have done that and it works perfectly.

How are you getting the message off?? did you implement the message listener interface or MDB just listens on the queue in an infinite loop??
We implemented the second one..
Did you check that the MDB is listening on that queue. Queue names are case sensitive. It is possible that the MDB is not listening on that queue. It is possible that the JNDI binding was not successful.

The best place to start with is to look at the qstatus and get the process ID. See if that is your MDBs process ID.

Hope this helps
_________________
Keka
Back to top
View user's profile Send private message
Vin
PostPosted: Sun Sep 28, 2003 10:57 am    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

Keka,
Thanks for the reply. We are using weblogic as our app server and I already bound the MQQueueConnectionFactory and the MQQueue in JNDI. I can see this using the admin console. I was able to recieve messages using a simple QueueReciever example supplied with weblogic ( I tweaked this to point to the weblogic queue). We want to use MDBs, which is the approach we want to follow. I deployed the MDB and put a message on the testqueue and the MDB never seems to pick it up.

I looked at the JMSConnectionAlive attribute in the weblogic console and it shows a false there. What is the qstatus which you were referring to? also how can I check whether the process id is the same? this is how my weblogic-ejb-jar.xml looks like

<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN" "http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd">

<!-- Sample MessageDriven bean Weblogic deployment descriptor -->

<weblogic-ejb-jar>

<weblogic-enterprise-bean>
<ejb-name>jmsMessageformat</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>200</max-beans-in-free-pool>
<initial-beans-in-free-pool>20</initial-beans-in-free-pool>
</pool>
<initial-context-factory>
<destination-jndi-name>MQQueue</destination-jndi-name>
</message-driven-descriptor>
<jndi-name>jms.Messageformat</jndi-name>
</weblogic-enterprise-bean>

</weblogic-ejb-jar>


Please let me know if you find anything wrong with this.

Thanks so much
Back to top
View user's profile Send private message
Vin
PostPosted: Sun Sep 28, 2003 11:35 am    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

<weblogic-ejb-jar>

<weblogic-enterprise-bean>
<ejb-name>jmsMessageformat</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>200</max-beans-in-free-pool>
<initial-beans-in-free-pool>20</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>MQQueue</destination-jndi-name>
<provider-url>t3://192.168.0.2:7001</provider-url>
<initial-context-factory>weblogic.jndi.WLInitialContextFactory</initial-context-factory>
<connection-factory-jndi-name>MQQueueConnectionFactory</connection-factory-jndi-name>
</message-driven-descriptor>
<jndi-name>jms.Messageformat</jndi-name>
</weblogic-enterprise-bean>

</weblogic-ejb-jar>


I get the following exception after changing my deployment descriptor

java.lang.NullPointerException - at java.lang.NullPointerException

at weblogic.jms.client.JMSSession.setMessageListener(JMSSession.java:109
7)
at weblogic.ejb20.internal.JMSConnectionPoller.disconnectFromJMS(JMSConn
ectionPoller.java:1141)
at weblogic.ejb20.internal.JMSConnectionPoller.cancelJMSConnectionPollin
g(JMSConnectionPoller.java:724)
at weblogic.ejb20.deployer.MessageDrivenBeanPoolInfoImpl.onUndeploy(Mess
ageDrivenBeanPoolInfoImpl.java:117)
at weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.onUndeploy(MessageD
rivenBeanInfoImpl.java:662)
at weblogic.ejb20.internal.BaseEJBHome.undeploy(BaseEJBHome.java:228)
at weblogic.ejb20.internal.MessageDrivenEJBHome.undeploy(MessageDrivenEJ
BHome.java:292)
at weblogic.ejb20.deployer.EJBDeployer.deactivate(EJBDeployer.java:1738)

at weblogic.ejb20.deployer.EJBModule.doDeactivate(EJBModule.java:618)
at weblogic.ejb20.deployer.EJBModule.deactivate(EJBModule.java:443)
at weblogic.j2ee.J2EEApplicationContainer.deactivateModule(J2EEApplicati
onContainer.java:1612)
at weblogic.j2ee.J2EEApplicationContainer.syncState(J2EEApplicationConta
Back to top
View user's profile Send private message
Vin
PostPosted: Tue Sep 30, 2003 7:56 pm    Post subject: Reply with quote

Master

Joined: 25 Mar 2002
Posts: 212
Location: India

I finally got this to work. I had to put tihs line in my code and everything started working fine

QueueReceiver receiver = qSession.createReceiver(queueName);
qcon.start();
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Messaging driven bean listening for message on an MQQueue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.