geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Mehlhase <>
Subject Message Driven Bean is not receiving messages
Date Mon, 24 Aug 2009 13:23:30 GMT
Hi everyone,

My setup is the following: I'm using Geronimo 2.1.4 on linux under
Java 1.6 developing with Eclipse 3.5 EE (I'm using the nightly built
2.1.5 GEP plugin)

I'm trying to set up a small message driven bean which receives
messages that I've send from a JAX-WS Webservice. So I went into the
adminstration console and created a JMS resource with one connection
factory and one destination (called Test, TestFactory and TestQueue
respectively). After doing so I wrote the webservice and it looks like

public class TestServer {
	private static final Logger log = Logger.getLogger(TestServer.class);
	@Resource(name = "TestFactory")
	private ConnectionFactory factory;
	@Resource(name = "TestQueue")
	private Destination destination;

	public void test() {
		try {
			Connection con = factory.createConnection();
			Session s = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
			MessageProducer p = s.createProducer(destination);
			con.close();"Sent message");
		} catch (JMSException e) {
			log.warn("Exception", e);
(I'm not sure whether the connection.start() call is necessary but I
added it "just in case" - it does not work without neither)
Than I created the EJB like this:

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination",
propertyValue = "TestQueue") }, mappedName = "TestQueue")
public class MDB implements MessageListener {
	private static Logger log = Logger.getLogger(MDB.class);

	public void onMessage(Message message) {"WE GOT A MESSAGE!");

(I've played around with the items of @MessageDriven annotation
(removing activation config, removing the mapped name) - nothing did
change anything).
The openejb-jar.xml is:


(I left out some namespace declarations)

If I invoke the webservice I see the "Sent message" log entry but the
EJB seems not to receive it (in fact it even does not get
So I checked the logs and have not found any error message and
therefore enabled the logs for ActiveMQ to see whether the message is
actually received. I found the following:

Upon deployment:
2009-08-24 14:49:35,174 INFO  [startup] Jndi(name=TestEJB/MDB) -->
2009-08-24 14:49:35,208 DEBUG [ActiveMQEndpointWorker] Starting
2009-08-24 14:49:35,219 DEBUG [ActiveMQEndpointWorker] Started
2009-08-24 14:49:35,219 INFO  [startup] Created
Ejb(deployment-id=TestEJB/MDB, ejb-name=MDB,
2009-08-24 14:49:35,219 INFO  [startup] Deployed
2009-08-24 14:49:35,328 DEBUG [AbstractRegion] Adding destination:
2009-08-24 14:49:35,356 DEBUG [JournalPersistenceAdapter] Waking for
checkpoint to complete.
2009-08-24 14:49:35,387 DEBUG [JournalPersistenceAdapter] Checkpoint started.
2009-08-24 14:49:35,390 DEBUG [JournalPersistenceAdapter] Checkpoint done.
2009-08-24 14:49:35,414 DEBUG [AbstractRegion] Adding destination:
2009-08-24 14:49:35,423 DEBUG [AbstractRegion] Adding destination:

Upon Invocation of the Webservice:
2009-08-24 14:50:01,022 DEBUG [ActiveMQSession] Sending message:
ActiveMQTextMessage {commandId = 0, responseRequired = false,
messageId = ID:yoda-40121-1251118162624-3:4:1:1:1, originalDestination
= null, originalTransactionId = null, producerId =
ID:yoda-40121-1251118162624-3:4:1:1, destination = topic://testqueue,
transactionId = null, expiration = 0, timestamp = 1251118201019,
arrival = 0, correlationId = null, replyTo = null, persistent = true,
type = null, priority = 4, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content =
null, marshalledProperties = null, dataStructure = null,
redeliveryCounter = 0, size = 0, properties = null, readOnlyProperties
= true, readOnlyBody = true, droppable = false, text = Test}
2009-08-24 14:50:01,056 DEBUG [AbstractRegion] Adding destination:
2009-08-24 14:50:01,057 DEBUG [AbstractRegion] Adding destination:
2009-08-24 14:50:01,095 INFO  [TestServer] Sent message
2009-08-24 14:50:01,132 DEBUG [AbstractRegion] Removing consumer:

I do not know what these "Adding Destination" messages mean, but that
they are not in sync at deployment and afterwards makes me wonder
whether this could be the reason why the EJB is not receiving messages
and what could be the reason that they are not in sync.

Any help is appreciated.


View raw message