• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You get the idea
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic