<!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;">
    JMS consumer not connecting after upgrade to JBoss 5.1.0
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/hbhinder">h bhinder</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/629122#629122">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>We have the following set up in the production envrionment:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>- our application is running on 3 clustered Jboss instances with spring framework. Each machine has a JMS queue where messages are sent.</p><p>- we have a listener on a separate machine that listens to all 3 queues for messages. If we configure the listener to use ClusteredXAConnectionFactory (which was working as expected in JBoss 4.2.3 with JBoss Messaging), we get the following error at startup. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2011-09-27 13:30:29,200 INFO&#160; [org.springframework.jms.listener.DefaultMessageListenerContainer] (ListGeneratorContainer-5) Setup of JMS message listener invoker failed for destination 'JBossQueue[ListGeneratorQueue]' - trying to recover. Cause: This invocation should not be handled here!</p><ol style="list-style-type: lower-alpha;"><li>java.lang.IllegalStateException: This invocation should not be handled here!</li></ol><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientClusteredConnectionFactoryDelegate$createConnectionDelegate$aop(ClientClusteredConnectionFactoryDelegate.java:260)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.createConnectionDelegate(ClientClusteredConnectionFactoryDelegate.java)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The connection configuration is as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!--JNDI Environment Template for JMS--&gt;</p><p>&#160;&#160;&#160; &lt;bean id="jndiTemplateExternal" class="org.springframework.jndi.JndiTemplate" lazy-init="true"&gt;</p><p>&#160;&#160;&#160; &lt;property name="environment"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;props&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;prop key="java.naming.factory.initial"&gt;org.jnp.interfaces.NamingContextFactory&lt;/prop&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;prop key="java.naming.provider.url"&gt;IP1:1100,IP2:1100,IP3:1100&lt;/prop&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;prop key="java.naming.factory.url.pkgs"&gt;org.jboss.naming:org.jnp.interfaces&lt;/prop&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/props&gt;</p><p>&#160;&#160;&#160; &lt;/property&gt;</p><p>&#160;&#160;&#160; &lt;/bean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;bean id="jmsConnectionFactoryExternal" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true"&gt;</p><p>&#160;&#160;&#160; &lt;property name="jndiTemplate" ref="jndiTemplateExternal"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="jndiName" value="ClusteredXAConnectionFactory"/&gt;</p><p>&#160;&#160;&#160; &lt;/bean&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If we replace jndiName with XAConnectionFactory, the application starts up but the listener doesn't process any messages and they remain unconsumed in the queues until JBoss is restarted. On restarting JBoss, all the existing messages get processed but any new messages still remain stuck.</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/629122#629122">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>