You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ferry97 <vr...@yahoo.com> on 2007/08/13 05:25:59 UTC

Running MDB (EJB3) in JBoss

Hi,
I'm running on :
JBoss AS 4.2.0
ActiveMQ 4.1.1

I wonder why my MDB only process the message when it was first time
deployed.

The scenario :
1. Run Jboss server
2. Deploy my MDB
3. run client (send message to MDB's monitoring queue)
4. Nothing happen...
5. Delete my MDB
6. Redeploy my MDB
7. It works... my MDB process the message
8. run client (same as point3)
9. nothing happen...

Why ?

Any help will be highly appreciated.
Thanks.

Client snippet:
			InitialContext ic = new InitialContext(System.getProperties());
			//connect using active mq
			ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
			//----
			Queue queue = (Queue)ic.lookup("activemq/queue/outbound");
			ic.close();
			System.out.println("Queue testQueue exists");
			Connection connection = cf.createConnection();

			Session sess = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
			MessageProducer sender = sess.createProducer(queue);
			TextMessage msg = sess.createTextMessage("test activemq3");
			/* consume message asynchronously
			MessageConsumer consumer = sess.createConsumer(queue);
			consumer.setMessageListener(myListener);
			*/
			
			sender.send(msg);
			connection.close();

My MDB :
@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue
= "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination", propertyValue =
"queue.outbound") })
public class HelloMDB implements MessageListener {

	public void onMessage(Message arg0) {
		try {
			TextMessage tm = (TextMessage)arg0;
			System.out.println("Hello I'm Message Bean, receive msg: "+tm.getText());
		} catch (JMSException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}

Regards,
Ferry
-- 
View this message in context: http://www.nabble.com/Running-MDB-%28EJB3%29-in-JBoss-tf4258981s2354.html#a12120362
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Running MDB (EJB3) in JBoss

Posted by ferry97 <vr...@yahoo.com>.
Apparently this is a deadlock issue :
see :
http://www.nabble.com/-jira--Resolved%3A-%28AMQ-1092%29-Deadlock-when-ActiveMQ-4.X-is-run-as-an-embedded-broker-inside-JBoss-4.X-with-%22%3Cconfig-property-value%3Evm%3A--localhost%3C-config-property-value%3E%22-configured-in-the-ra.xml-file.-tf3908435s2354.html#a11081719
-- 
View this message in context: http://www.nabble.com/Running-MDB-%28EJB3%29-in-JBoss-tf4258981s2354.html#a12121360
Sent from the ActiveMQ - User mailing list archive at Nabble.com.