<!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="https://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 Bridge NOT handling Network Failure!
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/sakkie6yster">Izaak van Niekerk</a> in <i>JBoss Messaging</i> - <a href="https://community.jboss.org/message/759863#759863">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 need a JBoss JMS bridge to facilitate integration to a remote Websphere MQ connection. Essentially we have an application running on JBoss that need to send and receive messages to and from WMQ that is running on a remote server.</p><p>We are using JBoss 5.1.0.GA and</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> Websphere MQ 7.&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have setup the following three configurations (see below) in order to create the "bridge". I am able to send a message to the local JMS queue (TestQ - source) which is successfully picked up by the bridge service and actually sent to the target destination (The remote MQ queue). I have tested this and everything works 100%. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Problem is, as soon as I pull out a network cable to test a typical "network failure" the following exception is thrown (as seen on the JBoss App Console). After plugging the network cable back in, the exception is still thrown every 5 seconds and the message is never sent. Until I physically restart JBoss.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><em>12:24:03,948 ERROR [STDERR] 2012.09.17 12:24:03 MQJMS1023E rollback failed</em></p><p><em>12:24:03,948 WARN&#160; [Bridge] jboss.messaging:name=TestBridge,service=Bridge Will retry after a pause of 5000 ms</em></p><p><em>12:24:27,870 WARN&#160; [Bridge] jboss.messaging:name=TestBridge,service=Bridge Failed to set up connections</em></p><p><em>javax.naming.NamingException: Unable to retrieve actual object from queue. The exception was: javax.jms.JMSException: MQJMS2008: failed to open MQ queue SYSTEM.MQCONTEXT.ADMIN.QUEUE [Root exception is javax.jms.JMSException: MQJMS2008: failed to open MQ queue SYSTEM.MQCONTEXT.ADMIN.QUEUE]</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:902)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:840)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at javax.naming.InitialContext.lookup(InitialContext.java:396)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:597)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.naming.ExternalContext$CachedContext.invoke(ExternalContext.java:535)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at $Proxy247.lookup(Unknown Source)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:833)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at javax.naming.InitialContext.lookup(InitialContext.java:392)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:956)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1223)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.Bridge.access$1600(Bridge.java:68)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1569)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:619)</em></p><p><em>Caused by: javax.jms.JMSException: MQJMS2008: failed to open MQ queue SYSTEM.MQCONTEXT.ADMIN.QUEUE</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:406)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.MQQueueServices.getQueueForBrowse(MQQueueServices.java:269)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.JMSServicesMgr.getQueueForBrowse(JMSServicesMgr.java:156)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.MQQueueBrowser.getEnumeration(MQQueueBrowser.java:269)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:884)</em></p><p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 18 more</em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Setup:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have the following jars in server\default\lib folder:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>com.ibm.mq.commonservices.jar</p><p>com.ibm.mq.headers.jar</p><p>com.ibm.mq.jar</p><p>com.ibm.mq.jmqi.jar</p><p>com.ibm.mq.pcf-6.1.jar</p><p>com.ibm.mqetclient.jar</p><p>com.ibm.mqjms.jar</p><p>dhbcore.jar</p><p>mqcontext.jar</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: %value; font-size: 12pt;">TestQ:</span></p><p><span style="font-size: 12pt;"><span lang="EN">&#160;&#160;&#160; </span></span></p><p>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;</p><p>&lt;server&gt;</p><p>&lt;mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=TestIncoming" code="org.jboss.jms.server.destination.QueueService"&gt;</p><p>&lt;!-- Defining the DLQ for this TestQueue --&gt;</p><p>&lt;!-- &lt;attribute name="DLQ"&gt; jboss.messaging.destination:name=DLQ,service=Queue&lt;/attribute&gt;--&gt;</p><p>&lt;attribute name="JNDIName"&gt;queue/TestQ&lt;/attribute&gt;</p><p>&lt;!-- The number of times, undilivered messages would be resend --&gt;</p><p>&lt;attribute name="MaxDeliveryAttempts"&gt;-1&lt;/attribute&gt;</p><p>&lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;</p><p>&lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;</p><p>&lt;/mbean&gt;</p><p>&lt;/server&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> &#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 12pt; font-family: %value;">Remote WSMQ JMS Provider:</span>&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 12pt;">&#160; </span></p><p><span lang="EN"><span style="font-size: 12pt;">&#160;&#160; </span>&#160; </span></p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p>&lt;connection-factories&gt;</p><p>&lt;!-- The WSMQ JMS provider loader --&gt;</p><p>&lt;mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider"&gt;</p><p>&lt;attribute name="ProviderName"&gt;RemoteJMSProvider&lt;/attribute&gt;</p><p>&lt;attribute name="ProviderAdapterClass"&gt;org.jboss.jms.jndi.JNDIProviderAdapter&lt;/attribute&gt;</p><p>&lt;attribute name="FactoryRef"&gt;remote/edb2pre1.que.mgr&lt;/attribute&gt;</p><p>&lt;attribute name="QueueFactoryRef"&gt;remote/edb2pre1.que.mgr&lt;/attribute&gt;</p><p>&lt;attribute name="TopicFactoryRef"&gt;remote/edb2pre1.que.mgr&lt;/attribute&gt;</p><p>&lt;depends&gt;jboss.jndi:service=ExternalContext,jndiName=remote&lt;/depends&gt;</p><p>&lt;/mbean&gt;</p><p>&lt;!-- Bind a remote IBM MQ server --&gt;</p><p>&lt;mbean code="org.jboss.naming.ExternalContext" name="jboss.jndi:service=ExternalContext,jndiName=remote"&gt;</p><p>&lt;attribute name="JndiName"&gt;remote&lt;/attribute&gt;</p><p>&lt;attribute name="Properties"&gt;</p><p>java.naming.factory.initial=com.ibm.mq.jms.context.WMQInitialContextFactory</p><p>java.naming.provider.url=edb2pre2.momentum.co.za:1414/SYSTEM.DEF.SVRCONN</p><p>java.naming.security.authentication=none</p><p>&lt;/attribute&gt;</p><p>&lt;attribute name="InitialContext"&gt;javax.naming.InitialContext&lt;/attribute&gt;</p><p>&lt;/mbean&gt;</p><p><span style="font-size: 12pt;"><span lang="EN"></span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 12pt;"><span lang="EN"><span lang="EN">Test Bridge</span>:</span></span></p><p> <span style="font-size: 12pt;"><span lang="EN">&#160; </span></span></p><p><span style="font-size: 12pt;"><span lang="EN">&#160; </span></span></p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p>&lt;server&gt;</p><p>&lt;mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=TestBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml"&gt;</p><p>&lt;depends optional-attribute-name="SourceProviderLoader"&gt;jboss.messaging:service=JMSProviderLoader,name=JMSProvider&lt;/depends&gt;</p><p>&lt;depends optional-attribute-name="TargetProviderLoader"&gt;jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider&lt;/depends&gt;</p><p>&lt;attribute name="SourceDestinationLookup"&gt;/queue/TestQ&lt;/attribute&gt;</p><p>&lt;attribute name="TargetDestinationLookup"&gt;/remote/SS.GICSAW.FNBLIFE.REQUEST&lt;/attribute&gt;</p><p>&lt;attribute name="QualityOfServiceMode"&gt;0&lt;/attribute&gt;</p><p>&lt;attribute name="MaxBatchSize"&gt;5&lt;/attribute&gt;</p><p>&lt;attribute name="MaxBatchTime"&gt;1&lt;/attribute&gt;</p><p>&lt;attribute name="FailureRetryInterval"&gt;5000&lt;/attribute&gt;</p><p>&lt;attribute name="MaxRetries"&gt;-1&lt;/attribute&gt;</p><p>&lt;attribute name="AddMessageIDInHeader"&gt;false&lt;/attribute&gt;</p><p>&lt;/mbean&gt;</p><p>&lt;/server&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style=": ; font-size: 12pt;"><span lang="EN">I am not sure if anything else is required? Like I said, I am able to send a message and the message gets delivered as long as the network is up; i.e. I can probably assume</span></span></p><p><span style=": ; font-size: 12pt;"><span lang="EN">that my code is fine? Problem is when the network is down, the server keeps throwing the same exception even after the network is back up again.</span></span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/759863#759863">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Messaging at <a href="https://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>