[jboss-user] [Messaging, JMS & JBossMQ] - MDB does not get messages

artemgolubev do-not-reply at jboss.com
Mon Nov 20 10:46:08 EST 2006


Hi,
My MDB bean does not get messages.
On deployment it writes:
INFO  [EJBContainer] STARTED EJB: com.nexplore.messagebus.ShoppingCartDispatcher ejbName: queue/ShoppingCartDispatcher
WARN  [MessagingContainer] Could not find the queue destination-jndi-name=queue/ShoppingCartDispatcher
WARN  [MessagingContainer] destination not found: queue/ShoppingCartDispatcher reason: javax.naming.NameNotFoundException: ShoppingCartDispatcher not bound
WARN  [MessagingContainer] creating a new temporary destination: queue/ShoppingCartDispatcher
INFO  [ShoppingCartDispatcher] Bound to JNDI name: queue/ShoppingCartDispatcher
INFO  [EJB3Deployer] Deployed: file:/C:/Apps/JBoss405/server/nexplore/deploy/mb-ejb.jar


MDB:
@MessageDriven(name="queue/ShoppingCartDispatcher",
		activationConfig={
	           @ActivationConfigProperty(
		            propertyName="destination", 
		            propertyValue="queue/ShoppingCartDispatcher"),
	           @ActivationConfigProperty(
	                propertyName="destinationType", 
	                propertyValue="javax.jms.Queue"),
	           @ActivationConfigProperty(
	                propertyName="messageSelector", 
	                propertyValue="MessageFormat = 'Version 3.4'"),
	           @ActivationConfigProperty(
	                propertyName="acknowledgeMode", 
	                propertyValue="Auto-acknowledge")})
public class ShoppingCartDispatcher implements MessageListener {

	@EJB private ShoppingCartLocal shoppingCart;
	
	public void onMessage(Message msg) {
		try {
			System.out.println("OK");
		} catch (Exception e) {
			...
		} 
	}
}



Sender:
public @Stateless class ShoppingCartSenderBean implements ShoppingCartSender {
	@Resource(mappedName="ConnectionFactory")
	private ConnectionFactory connectionFactory;
	
	@Resource(mappedName="queue/ShoppingCartDispatcher")
	private Queue queue;


	public void sendPayment(String item, String amount) throws JMSException {
		Connection connect = connectionFactory.createConnection();
		Session session = connect.createSession(true, 0);
		ObjectMessage msg = session.createObjectMessage();
		MessageProducer producer = session.createProducer(queue);
		PayDTO pay = new PayDTO();
		pay.setItem(item);
		pay.setAmount(new BigDecimal(amount));
		msg.setObject(pay);

		producer.send(msg);
		connect.close();

	}
	
}

I can not find out what is the problem? 
May be MDB annotation is incorrect?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987319#3987319

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987319



More information about the jboss-user mailing list