aspose file tools*
The moose likes BEA/Weblogic and the fly likes WL guru's - message bean not receiving messages from JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WL guru Watch "WL guru New topic
Author

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

Greg Garrison
Greenhorn

Joined: Nov 11, 2002
Posts: 4
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WL guru's - message bean not receiving messages from JMS