• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

WL guru's - message bean not receiving messages from JMS

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On weblogic 6.2 simple message bean does not receive the messages sent to a queue. The weblogic console states that there are 24 messages in the queue and 15 consumers but sending a message does not trigger the onMessage function. Here is the code and deployment descriptors:
Message bean:
package testbeans;
import javax.ejb.*;
import javax.jms.*;
public class TextMessageBean implements MessageDrivenBean, MessageListener {

MessageDrivenContext ejbContext;

public void ejbRemove() throws EJBException {
System.out.println("Exiting TextMessageBean");
ejbContext = null;
}

public void ejbCreate() {

System.out.println("inside TextMessageBean.ejbCreate");
}
public void setMessageDrivenContext(MessageDrivenContext arg0) throws EJBException {

ejbContext = arg0;
System.out.println("inside TextMessageBean.setMessageDrivenContext");

}
public void onMessage(Message message) {

System.out.println("inside TextMessageBean.onMessage");


}
}
ejb-jar.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<enterprise-beans>

<!-- Message Driven Beans-->

<message-driven>

<ejb-name>TextMessageBean</ejb-name>
<ejb-class>testbeans.TextMessageBean</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>

<resource-ref>
<res-ref-name>jms/PhoscoJMSFactory</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>

</enterprise-beans>

<assembly-descriptor>


<container-transaction>
<method>
<ejb-name>TextMessageBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>


</assembly-descriptor>

</ejb-jar>

weblogic-ejb-jar.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
<weblogic-ejb-jar>


<!--Message driven beans-->
<weblogic-enterprise-bean>

<ejb-name>TextMessageBean</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>50</max-beans-in-free-pool>
<initial-beans-in-free-pool>10</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>PhoscoJMSQueue</destination-jndi-name>
</message-driven-descriptor>
<jndi-name>TextMessageBean</jndi-name>

</weblogic-enterprise-bean>

</weblogic-ejb-jar>
[ November 11, 2002: Message edited by: Greg Garrison ]
[ November 12, 2002: Message edited by: Greg Garrison ]
[ November 15, 2002: Message edited by: Greg Garrison ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic