aspose file tools*
The moose likes BEA/Weblogic and the fly likes I get message to queue, but not to MDB Bean. So close yet so far! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "I get message to queue, but not to MDB Bean. So close yet so far!" Watch "I get message to queue, but not to MDB Bean. So close yet so far!" New topic
Author

I get message to queue, but not to MDB Bean. So close yet so far!

Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Hello,

I first want to say, thank you so much for the help that I've gotten here so far!

I have a queue called SynchQueue that I can get multiple messages to, but the OnMessage routine does not trigger in the MDB. I've followed an example
and another tutorial, but no luck so far. Any further help is greatly appreciated!

The client is in a java project. The Ejb's are within another (EJB project)
within the same application. I am using Weblogic 8.1 Workshop.

I have built the application. The 1 ejb below is deployed and seen in App Console. Two others are not, but I did not try to access them.

My SynchMDBBean.ejb is:
/**
* @ejbgen:message-driven default-transaction="NotSupported" transaction-type="Container"
* ejb-name="SynchMDB"
* destination-jndi-name="SynchQueue"
* destination-type = javax.jms.Queue
*
*/
public class SynchMDBBean extends GenericMessageDrivenBean implements MessageDrivenBean, MessageListener
{
private MessageDrivenContext context;
public void ejbCreate() {}
public void ejbRemove(){}
public void setMessageDrivenContext(MessageDrivenContext ctx)
{
context =ctx;
}
public void onMessage(Message msg) {
try
{
System.out.println("Synch queue got message");
}
catch(Exception ex)
{
System.out.println("Encountered the following exception: " + ex.getMessage());
}

}
}
ejb-jar.xml

<ejb-jar>
<enterprise-beans>
...
<ejb-name>SynchMDB</ejb-name>
<ejb-class>EJBFolder.SynchMDBBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>SynchMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

weblogic-ejb-jar.xml

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
...
<ejb-name>SynchMDB</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>SynchQueue</destination-jndi-name>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Can you add a System.out.println() in the ejbCreate()? Does the output appear in your WebLogic Console when you start the server?
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Also, do you have a value set for initial-beans-in-free-pool in your weblogic-ejb-jar.xml?
[ April 12, 2006: Message edited by: Chris Mathews ]
Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Chris,

I added initial-beans-in-free-pool and then the MDB did get the message.
As always, your help is greatly appreciated!!

Though I can't offer you a round online- a beer (and you may not drink alchohol anyway)
How about a round of applause:

javascript: x()
jumpingjoy

javascript: x()
jumpingjoy

javascript: x()
jumpingjoy
Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
You get the idea
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Glad to help partner. Feel free to stick around these parts and pitch in a helping hand every now and then.
Ken Rubin
Ranch Hand

Joined: Mar 08, 2004
Posts: 66
Chris,

Will do. I can help the most now with regular java, but will check
Weblogic questions and try to help. Even if I don't
know certain things, I can look it up and offer my 2 cents

Regards,

Ken
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I get message to queue, but not to MDB Bean. So close yet so far!
 
Similar Threads
How to form a MDB with the topic?
How to not acknowledge a JMS message from an MDB
Associate Same Mdb file to multiple queue in Ejb3 jboss 5.x server
WL guru's - message bean not receiving messages from JMS
JMS subscription problem