Hello all,
Iam
testing a simple application using MDB in Weblogic 8.1 but the onMessage() method never gets triggered when messages arrive on the queue!.
This is the gist of things : A session bean writes to the queue and an MDB should receive the message and do a database insert by calling the create method on a CMP.
These are my descriptors:
<ejb-jar>.xml
---------------------------------------------------------
.....
<message-driven>
<display-name>CustomerMDB</display-name>
<ejb-name>CustomerMDB</ejb-name>
<ejb-class>autofactory.CustomerMDBBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
.......
-------------------------------------------------------------
weblogic-ejb-jar.xml
<weblogic-enterprise-bean>
<ejb-name>CustomerMDB</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>20</max-beans-in-free-pool>
<initial-beans-in-free-pool>5</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>queue/Autoshop</destination-jndi-name> ;
</message-driven-descriptor>
</weblogic-enterprise-bean>
-------------------------------------------------------------------
This is a portion of my config.xml for the weblogic server showing the JMS setup.
config.xml (weblogic)
<JMSConnectionFactory JNDIName="jms/Autoshop" Name="AutoshopFactory"
Targets="myserver" XAConnectionFactoryEnabled="true"/>
<JMSServer Name="JMSClemDEV" PagingStore="" Store="Ejb20Store" Targets="myserver">
<JMSTopic CreationTime="1105766985348" JNDIName="topic/Autoshop"
JNDINameReplicated="false" Name="TopicAutoshop"/>
<JMSQueue CreationTime="1105775501794"
ErrorDestination="ErrorQueue" ExpirationPolicy="Redirect"
JNDIName="queue/Autoshop" JNDINameReplicated="false" Name="QueueAutoshop"/>
<JMSQueue CreationTime="1106043185507" JNDIName="queue/ErrorQ"
JNDINameReplicated="false" Name="ErrorQueue"/>
</JMSServer>
<JMSFileStore Directory="ejb20filestore" Name="Ejb20Store"/>
------------------------------------------------------------------------------- ------------------
The queue that Iam writing to is "queue/Autoshop". The queue uses a persistent filestore and I can see that the file contains the messages. But when I check the console it show "MESSAGE_PENDING" = 0 and "MESSAGES" = 0!
I have some 'println' in onMessage(), but they never get printed!!..The MDB just doesn't listen to the destination!!!
Here is my onMessage() method:
Here is the code from the session bean that writes to the queue:
The QueueConnectionFactory is XA enabled..
Thanks guys,
CLement