tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johnny Guo <>
Subject RE: MDB not invoked
Date Thu, 12 Apr 2012 01:51:43 GMT

I have tried to setup it following the examples, but just not working for me.
Here are some codes:

1)     No annotation in mdb , just a onMessage method. The ejb-jar.xml:









2)     The resources in the server.xml for tomcat in Eclipse:

<Resource auth="Container" description="Report Standard JMSQueue" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="ReportStandardJMSQueue"  physicalName="ReportStandardJMSQueue" type="org.apache.activemq.command.ActiveMQQueue"/>
           <Resource auth="Container" brokerName="LocalActiveMQBroker" brokerURL="tcp://localhost:61616"
description="Report Standard JMS Connection Factory"    factory="org.apache.activemq.jndi.JNDIReferenceFactory"
name="jms/tdm-newjena/ReportStandardJMSConnFactory" type="org.apache.activemq.ActiveMQConnectionFactory"/>

<Context docBase="C:\JavaDev\tools\apache-tomcat-6.0.29\webapps\openejb" path="/openejb"

3)     The code to send message:
                QueueConnection queueConnection = null;
        QueueSession queueSession = null;
        Queue queue = null;
        QueueSender queueSender = null;
        ObjectMessage message = null;

        try {
            // check if jndiContext and queueConnectionFactory are set if not
            // throw an exception

            if (jndiContext == null || queueConnectionFactory == null)
                throw new Exception("InitialContext or QueueConnectionFactory is not set");

             * Look up queue.
            queue = (Queue) jndiContext.lookup("ReportStandardJMSQueue");
            queueConnection = queueConnectionFactory.createQueueConnection();
            queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            queueSender = queueSession.createSender(queue);

             * Send message
            message = queueSession.createObjectMessage();

  "Jena reports - a message has been sent");


      I also tried the below in ejb-jar.xml, but it will say the queue has binded to context,
and if I removed the resource for this queue in server.xml, then it can't find the queue for
sending messages.

Best Regards,

Johnny Guo
VIT Tianjin
Mobile:   +86 13682195826

From: Romain Manni-Bucau [via OpenEJB] []
Sent: Wednesday, April 11, 2012 8:23 PM
To: Guo Qiang (Consultant)
Subject: Re: MDB not invoked


how did you configure:
1) the mdb
2) the jmx resources (queue, connection factory, ...)
3) the client

it sounds like a config error. If you can share some code we could help you
more efficiently.

Note: some JMS sample are here:

- Romain

2012/4/11 Johnny Guo <[hidden email]</user/SendEmail.jtp?type=node&node=4548744&i=0>>

> Hi,
> I'm new to openejb. Now i'm working with openejb integrated with Tomcat in
> Eclipse. Openejb can start successfully. One MDB was setup to listen to a
> jms queue and the start log like this:
> [INFO] Found ejb module EjbModule in war /newjena
> [INFO] Found ejb module EjbModule in war /newjena
> [INFO] Configuring enterprise application:
> C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena
> [INFO] Auto-linking resource-ref
> 'jms/tdm-newjena/ReportStandardJMSConnFactory' in bean StandardReportsBean
> to Resource(id=jms/tdm-newjena/ReportStandardJMSConnFactory)
> [INFO] Auto-linking resource-ref 'jms/tdm-newjena/ReportStandardJMSQueue'
> in
> bean StandardReportsBean to
> Resource(id=jms/tdm-newjena/ReportStandardJMSQueue)
> [INFO] Configuring Service(id=jms/tdm-newjena/ReportStandardJMSQueue,
> type=Resource, provider-id=Default Queue)
> [INFO] Auto-creating a Resource with id
> 'jms/tdm-newjena/ReportStandardJMSQueue' of type 'javax.jms.Queue for
> 'StandardReportsBean'.
> [INFO] Creating Resource(id=jms/tdm-newjena/ReportStandardJMSQueue)
> [INFO] Enterprise application
> "C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena"
> loaded.
> [INFO] Assembling app:
> C:\TDM\workspace\was_migr\newjena2\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\newjena
> [INFO] Jndi(name=StandardReportsBean) -->
> Ejb(deployment-id=StandardReportsBean)
> [INFO] Created Ejb(deployment-id=StandardReportsBean,
> ejb-name=StandardReportsBean, container=My MDB Container)
> But when the message is sent to the queue, the MDB can not be invoked.
>  What
> is the problem and how can i get more detail information if something like
> this happens?
> Thanks
> --
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

If you reply to this email, your message will be added to the discussion below:
To unsubscribe from MDB not invoked, click here<>.

View this message in context:
Sent from the OpenEJB User mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message