<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JMS MDB (Message Driven Bean)
</h3>
<span style="margin-bottom: 10px;">
    reply from <a href="http://community.jboss.org/people/tnguyen_75">Tuan Nguyen</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/548536#548536">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Thanks for the link. It's very helpful.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>However, I ran into a problem when I deploy the MDB ear file to Jboss. I got the following message:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Failed to create Resource SimpleMessageApp.ear - cause: java.lang.RuntimeException:org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** DEPLOYMENTS IN ERROR: Name -&gt; Error vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/ -&gt; org.jboss.deployers.spi.DeploymentException: Could not deploy vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/app-client-ic.jar/ DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/" is in error due to the following reason(s): java.lang.RuntimeException: message-destination has no jndi-name/resolved-jndi-name MessageDestinationReferenceMetaData{name=jms/QueueName,type=javax.jms.Queue,link=ejb-jar-ic.jar#PhysicalQueue,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Do you have any idea? (i'm not using EJB 3, just regular EJB)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here's the code of my SimpleMessageBean:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div id="_mcePaste">public class SimpleMessageBean implements MessageDrivenBean, MessageListener {</div><div id="_mcePaste">&#160;&#160;&#160; static final Logger logger = Logger.getLogger("SimpleMessageBean");</div><div id="_mcePaste">&#160;&#160;&#160; private transient MessageDrivenContext mdc = null;</div><div id="_mcePaste">&#160;&#160;&#160; private Context context;</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160; public SimpleMessageBean() {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("In SimpleMessageBean.SimpleMessageBean()");</div><div id="_mcePaste">&#160;&#160;&#160; }</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160; public void setMessageDrivenContext(MessageDrivenContext mdc) {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("In SimpleMessageBean.setMessageDrivenContext()");</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.mdc = mdc;</div><div id="_mcePaste">&#160;&#160;&#160; }</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160; public void ejbCreate() {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("In SimpleMessageBean.ejbCreate()");</div><div id="_mcePaste">&#160;&#160;&#160; }</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160; public void onMessage(Message inMessage) {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; TextMessage msg = null;</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (inMessage instanceof TextMessage) {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; msg = (TextMessage) inMessage;</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("MESSAGE BEAN: Message received: " + msg.getText());</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.warning("Message of wrong type: " +</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; inMessage.getClass().getName());</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (JMSException e) {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mdc.setRollbackOnly();</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (Throwable te) {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; te.printStackTrace();</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</div><div id="_mcePaste">&#160;&#160;&#160; } // onMessage</div><div id="_mcePaste"> </div><div id="_mcePaste">&#160;&#160;&#160; public void ejbRemove() {</div><div id="_mcePaste">&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.info("In SimpleMessageBean.remove()");</div><div id="_mcePaste">&#160;&#160;&#160; }</div><div id="_mcePaste">} // class</div><div> </div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks a bunch!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Tuan</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/548536#548536">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>