Author |
Message
|
Vin |
Posted: Sat Sep 27, 2003 9:24 pm Post subject: Messaging driven bean listening for message on an MQQueue |
|
|
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 |
|
 |
Keka |
Posted: Sun Sep 28, 2003 9:03 am Post subject: |
|
|
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 |
|
 |
Vin |
Posted: Sun Sep 28, 2003 10:57 am Post subject: |
|
|
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 |
|
 |
Vin |
Posted: Sun Sep 28, 2003 11:35 am Post subject: |
|
|
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 |
|
 |
Vin |
Posted: Tue Sep 30, 2003 7:56 pm Post subject: |
|
|
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 |
|
 |
|