users@glassfish.java.net

Re: Why is MDB not firing?

From: Ramesh Parthasarathy <Ramesh.Parthasarathy_at_Sun.COM>
Date: Thu, 10 Apr 2008 09:45:12 +0000

Hi Markus,
        From what i can interpret from the output looks like you have one
consumer, I guess "Aktuelle Zahl Konsumenten 1" means one consumer.
Which means any message to this topic should be received by the MDB
(assuming MDB is the only consumer you have).

Can you undeploy the MDB and check if the swing client is actually
sending the message to this destination where the MDB is listening to.
  Are QUIPSY_TOPIC and MY_TOPIC the same destination ?

Thanks
-Ramesh


Markus KARG wrote:
> For me, it looks like the message is not in the repository:
>
> Here is the result of imqcmd query dst:
>
> Abfragen von Ziel, wobei:
>
> -----------------------
> Zielname Zieltyp
> -----------------------
> QUIPSY_TOPIC Thema
>
> auf Broker, angegeben durch:
>
> --------------------------
> Host Primõrer Port
> --------------------------
> localhost 7676
>
> Zielname QUIPSY_TOPIC
> Zieltyp Thema
> Zielstatus RUNNING
> Administratorisch erstellt true
>
> Aktuelle Zahl Meldungen
> Actual 0
> In ▄bertragung 0
> Bytes der aktuellen Nachricht
> Actual 0
> In ▄bertragung 0
> Aktuelle Zahl von Produzenten 0
> Aktuelle Zahl Konsumenten 1
>
> H÷chstzahl Meldungen unbegrenzt (-1)
> Max. Gesamtgr÷▀e Meldungen (Byte) unbegrenzt (-1)
> Max. Gr÷▀e pro Meldung (Byte) unbegrenzt (-1)
> H÷chstzahl von Produzenten 100
>
> Verhalten bei Begrenzungen REJECT_NEWEST
> Obergrenze f³r Konsumentenfluss 1000
> Ist lokales Ziel false
> Warteschlange f³r nicht zugestellte Nachrichten verwenden true
>
> Ziel erfolgreich abgefragt.
>
>
>
> Ramesh schrieb:
>> Hi Markus,
>> Does the destination MY_TOPIC have the message that you sent from the
>> swing client, also could you verify if there is an active consumer for
>> the destination.
>> You could do this by either using the $GF_HOME/imq/bin/imqadmin tool
>> or using the "$GF_HOME/imq/bin/imqcmd query dst" command.
>>
>> Thanks
>> -Ramesh
>> Markus KARG wrote:
>>> I have written a small JMS sample using Java EE 5 SDK and try running
>>> it on the default GlassFish instance. A Swing Client (WebStart'ed) is
>>> sending a TextMessage into a topic (no exception thrown, no log
>>> entries). A MDB is listening on the topic (no exception thrown, no
>>> log entries). Can verify and deploy without any problems. But: The
>>> MDB does never walk into onMessage! I couldn't believe it, so I added
>>> both, logging and showing a message box as the very first line of
>>> onMessage. Both never happens. I thought it might be a typo in
>>> mappedName annotation, but as soon as I change the mappedName, I
>>> cannot deploy anymore, so the name IS correct (since I do not get ANY
>>> verify, deploy or runtime log entries).
>>>
>>> Please help, I am totally confused. I am using JMS on JOnAS 4.x for
>>> years, but I just can't get it running on GlassFish.
>>>
>>> Where's my fault?
>>>
>>> Here is the code for sending:
>>>
>>> @Resource(mappedName = "MY_CONNECTION_FACTORY")
>>> private static ConnectionFactory connectionFactory;
>>>
>>> @Resource(mappedName = "MY_TOPIC")
>>> private static Topic topic;
>>>
>>>
>>> try {
>>> final Connection connection =
>>> HelloClient.connectionFactory.createConnection();
>>> final Session session = connection.createSession(true,
>>> Session.AUTO_ACKNOWLEDGE);
>>> final MessageProducer producer =
>>> session.createProducer(HelloClient.this.topic);
>>> final Message msg = session.createTextMessage("JMS-Test Text Message");
>>> producer.send(msg, DeliveryMode.PERSISTENT, 3, 0);
>>> JOptionPane.showMessageDialog(null, "OK", "Test Titel",
>>> JOptionPane.OK_CANCEL_OPTION);
>>> } catch (final Throwable e) {
>>> JOptionPane.showMessageDialog(null, e.getMessage(), "Test Titel",
>>> JOptionPane.OK_CANCEL_OPTION);
>>> }
>>>
>>> (when running, it always shows "OK" but never an Exception)
>>>
>>> and here is the MDB code:
>>>
>>> package example.mdb;
>>> import javax.ejb.MessageDriven;
>>> import javax.jms.Message;
>>> import javax.jms.MessageListener;
>>> import javax.swing.JOptionPane;
>>> @MessageDriven(mappedName = "MY_TOPIC")
>>> public class TestMDB implements MessageListener {
>>> public void onMessage(Message arg0) {
>>> // For debug purposes, added logging or MessageBox in the first line,
>>> but it
>>> // never shows up!
>>> }
>>> }
>>>
>>> I am not using deployment descriptor entries.
>>>
>>> Thanks
>>> Markus
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net