<!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">JBoss 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;">
JBOSS Messaging Issue
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/mmuthu">Muthukumaran Manickavasagam</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/552965#552965">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I'm trying to bring up my hello world MDB in JBOSS 5.1 to see how i can get our messaging application into JBOSS 5.1 Messaging. The simple hellow world MDB gives me a wired issue. The MDB deployed fine and no problem in starting the JBOSS 5.1 AS. However when i tried to send a message from a client (servlet) which is also running in different JBOSS instance is always throwing the following exception while creating a session.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><code>09:03:24,790 ERROR [STDERR] java.lang.NullPointerException<br/>09:03:24,790 ERROR [STDERR]     at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:87)<br/>09:03:24,790 ERROR [STDERR]     at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.jms.client.delegate.ClientConnectionDelegate.createSessionDelegate(ClientConnectionDelegate.java)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.jms.client.JBossConnection.createSessionInternal(JBossConnection.java:269)<br/>09:03:24,791 ERROR [STDERR]     at org.jboss.jms.client.JBossConnection.createQueueSession(JBossConnection.java:165)<br/></code></p><p><code></code></p><p>However when i try to connect from a standalone JAVA program the messaging works fine. I have no clue on what i should do now. The following are the configuration,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>ejb-jar.xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><code><message-driven><br/>      <ejb-name>HelloWorldMDB</ejb-name><br/>      <ejb-class>com.yodlee.messaging.mdbs.HelloWorldMDB</ejb-class><br/>      <transaction-type>Container</transaction-type><br/>      <message-driven-destination><br/>        <destination-type>javax.jms.Queue</destination-type><br/>        <subscription-durability>Durable</subscription-durability></message-driven-destination><br/>      <resource-ref><br/>        <res-ref-name>HelloWorldMDB</res-ref-name><br/>        <res-type>javax.jms.QueueConnectionFactory</res-type><br/>        <res-auth>Container</res-auth></resource-ref> <br/></message-driven></code></p><p><code></code></p><p><code>jboss.xml:</code></p><p><code></code></p><p><code><code><message-driven><br/>                <ejb-name>HelloWorldMDB</ejb-name><br/>                <destination-jndi-name>queue/HelloWorldQueue</destination-jndi-name><br/>                <mdb-user>mqm</mdb-user><br/>                <mdb-passwd>mqm</mdb-passwd><br/>                <resource-ref><br/>                        <res-ref-name>HelloWorldMDB</res-ref-name><br/>                        <jndi-name>MDBDLQCF</jndi-name><br/>                </resource-ref><br/></message-driven><br/></code></code></p><p><code><code>The client code which i use it in servelt and stand alone program is exactly same like below,</code></code></p><p><code><code></code></code></p><p><code><code><code>Properties env = new Properties();<br/><br/>        String queueName = "queue/HelloWorldQueue";<br/>        String CFname = "ConnectionFactory";<br/><br/>        env.put(Context.PROVIDER_URL, "jnp://....:1099");<br/>        env.put(Context.INITIAL_CONTEXT_FACTORY,<br/>                "org.jnp.interfaces.NamingContextFactory");<br/>        env<br/>                .put(Context.URL_PKG_PREFIXES,<br/>                        "org.jboss.naming:org.jnp.interfaces");<br/><br/>        try {<br/>            InitialContext ctx = new InitialContext(env);<br/><br/>            System.out.println("Looking up for queue");<br/>            System.out.println(ctx.lookup(queueName).getClass().getName());<br/>            Queue destination = (Queue) ctx.lookup(queueName);<br/><br/>            System.out.println(destination.getQueueName());<br/><br/>            System.out.println("Looking up for connection factory");<br/>            System.out.println(ctx.lookup(CFname).getClass().getName());<br/>            QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup(CFname);<br/><br/>            System.out.println("getting connection");<br/>            QueueConnection conn = qcf.createQueueConnection("abc", "abc");<br/>            System.out.println("creating session");<br/>            QueueSession queueSession = conn.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);<br/><br/><br/>            QueueSender sender = queueSession.createSender(destination);<br/><br/>            TextMessage message = queueSession.createTextMessage();<br/><br/>            message.setText("Test Message");<br/><br/>            System.out.println("Sending Message...");<br/><br/>            sender.send(message);<br/>            System.out.println("Finished Sending Message.");<br/><br/>            sender.close();<br/>            conn.close();<br/>            queueSession.close();<br/><br/>        } catch (Exception e) {<br/>            e.printStackTrace();<br/>        }<br/></code></code></code></p><p><code><code><code></code></code></code><code><code><code><p>Can you help me fixing this problem? Do you need any other information to debug? I'm using JBOSS Messaging 1.4.6 GA version.</p></code></code></code></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/552965#552965">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>