cancel
Showing results for 
Search instead for 
Did you mean: 

Message Driven Bean can not be triggered

0 Kudos

Hi guys,

I have the following problem. I have implemented a Scheduler project as a bean where in I define a job. First after the deployment, I created a task for this Job, using the Netweaver Administrator (nwa). The job is also working fine.

The next step would be to send a message into a specific queue. I have created another bean project (Message Driven Bean) which contains an onMessage Method. In the annotation of this Bean, I specify the Queue I am listening to:

@MessageDriven(mappedName="jmsqueues/default/H2OMDBQueue", activationConfig={@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue")})

This queue is the same like the Queue where I am sending some messages after having triggered my Job. So, that's why I expect my onMessage Method to be triggered since I sent successfully some messages to the Queue. Unfortunately, nothing happens.

For more information:

jms-resources.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>

<jms-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="jms-resources.xsd">

<connection-factory>

<name>H2OMDBFactory</name>

<sap-local-factory-type>

<type>javax.jms.XAQueueConnectionFactory</type>

<virtual-provider>default</virtual-provider>

</sap-local-factory-type>

</connection-factory>

<destination>

<name>H2OMDBQueue</name>

<type>javax.jms.Queue</type>

<sap-local-destination-type>

<virtual-provider>default</virtual-provider>

</sap-local-destination-type>

</destination>

</jms-resources>

Can you please provide me some help??? Thanx in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Didn't really get the whole scenario, but I would recommend you to check the following:

1. Make sure the message is being sent, to the same queue.

2. Make sure the MDB is listening to the same queue.

3. Is there any other MDB listening to this same queue. If yes, then this might be a problem as the container does not gurantee that the message will be sent to which listener, in this case of a queue and not topic. It might be possible that the message is lost and consumed by some other listener.

Best Regards, Gagan.

Former Member
0 Kudos

We found the solution how it works... But its a little bit strange.

Before we had the following on the sending part:

connectionFactory = (ConnectionFactory) ctx.lookup("jmsfactory/default/FactoryName");
destination = (Queue) ctx.lookup("jmsqueues/default/QueueName");

We could not use EJB injection here as the place were it was used is a POJO.

Now in our Job-Bean we do the following:


	@Resource(name="FactoryName")
	private ConnectionFactory connectionFactory;

	@Resource(name="QueueName")
	private Queue destination;

and then we transfer the connection factory and queue to our POJO... and it works... From our understanding both should be the same???

Frank

Answers (0)