Hi,
Thank you for taking the time and respond. This was helpful. I was able to
deploy a Message Driven Bean (MDB). How ever the onMessage is not getting
triggered. When I deploy the same code on the TomEE , it works fine. But the
same code does not seem to work when I deploy it on Tomcat 6.0 with OpenEJB.
Is there any other setting I need to configure ?. Here is the code,
MDB Class
@MessageDriven(
activationConfig = { @ActivationConfigProperty(
propertyName = "destinationType", propertyValue
= "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination",
propertyValue = "APP.JMS.QUEUE")},
mappedName = "APP.JMS.QUEUE")
public class MyPersonEntityMDB implements MessageListener {
@Resource(name="MyJmsConnectionFactory")
private ActiveMQConnectionFactory connectionFactory;
/**
* Default constructor.
*/
public MyPersonEntityMDB() {
// TODO Auto-generated constructor stub
}
/**
* @see MessageListener#onMessage(Message)
*/
public void onMessage(Message message) {
// TODO Auto-generated method stub
System.out.println("Got Message " + message.toString());
}
}
I configure this in the openejb.xml
<Container id="My MDB Container " type="MESSAGE">
# The resource adapter delivers messages to the container
# ResourceAdapter My JMS Resource Adapter
ResourceAdapter MyJmsResourceAdapter
# Specifies the message listener interface handled by this container
MessageListenerInterface javax.jms.MessageListener
# Specifies the activation spec class
ActivationSpecClass org.apache.activemq.ra.ActiveMQActivationSpec
# Specifies the maximum number of bean instances that are
# allowed to exist for each MDB deployment.
InstanceLimit 20
</Container>
<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
# Do not start the embedded ActiveMQ broker
BrokerXmlConfig
ServerUrl tcp://localhost:61616
</Resource>
<Connector id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
ResourceAdapter MyJmsResourceAdapter
# Specifies if the connection is enrolled in global transaction
# allowed values: xa, local or none
#TransactionSupport xa
# Maximum number of physical connection to the ActiveMQ broker
PoolMaxSize 50
# Minimum number of physical connection to the ActiveMQ broker
PoolMinSize 10
# Maximum amount of time to wait for a connection
ConnectionMaxWaitMilliseconds 60000
# Maximum amount of time a connection can be idle before being reclaimed
ConnectionMaxIdleMinutes 15
</Connector>
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/Deploying-MDB-s-using-OpenEJB-with-Tomcat-6-0-37-tp4677709p4677754.html
Sent from the TomEE Users mailing list archive at Nabble.com.