<!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;"> </p><p> Websphere MQ 7.  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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  [Bridge] jboss.messaging:name=TestBridge,service=Bridge Will retry after a pause of 5000 ms</em></p><p><em>12:24:27,870 WARN  [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>        at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:902)</em></p><p><em>        at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:840)</em></p><p><em>        at javax.naming.InitialContext.lookup(InitialContext.java:396)</em></p><p><em>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</em></p><p><em>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</em></p><p><em>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</em></p><p><em>        at java.lang.reflect.Method.invoke(Method.java:597)</em></p><p><em>        at org.jboss.naming.ExternalContext$CachedContext.invoke(ExternalContext.java:535)</em></p><p><em>        at $Proxy247.lookup(Unknown Source)</em></p><p><em>        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:833)</em></p><p><em>        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)</em></p><p><em>        at javax.naming.InitialContext.lookup(InitialContext.java:392)</em></p><p><em>        at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)</em></p><p><em>        at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)</em></p><p><em>        at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:956)</em></p><p><em>        at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1223)</em></p><p><em>        at org.jboss.jms.server.bridge.Bridge.access$1600(Bridge.java:68)</em></p><p><em>        at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1569)</em></p><p><em>        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>        at com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:406)</em></p><p><em>        at com.ibm.mq.jms.MQQueueServices.getQueueForBrowse(MQQueueServices.java:269)</em></p><p><em>        at com.ibm.mq.jms.JMSServicesMgr.getQueueForBrowse(JMSServicesMgr.java:156)</em></p><p><em>        at com.ibm.mq.jms.MQQueueBrowser.getEnumeration(MQQueueBrowser.java:269)</em></p><p><em>        at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:884)</em></p><p><em>        ... 18 more</em></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Setup:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have the following jars in server\default\lib folder:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: %value; font-size: 12pt;">TestQ:</span></p><p><span style="font-size: 12pt;"><span lang="EN">    </span></span></p><p><?xml version="1.0" encoding="UTF-8" standalone="yes"?></p><p><server></p><p><mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=TestIncoming" code="org.jboss.jms.server.destination.QueueService"></p><p><!-- Defining the DLQ for this TestQueue --></p><p><!-- <attribute name="DLQ"> jboss.messaging.destination:name=DLQ,service=Queue</attribute>--></p><p><attribute name="JNDIName">queue/TestQ</attribute></p><p><!-- The number of times, undilivered messages would be resend --></p><p><attribute name="MaxDeliveryAttempts">-1</attribute></p><p><depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends></p><p><depends>jboss.messaging:service=PostOffice</depends></p><p></mbean></p><p></server></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 12pt; font-family: %value;">Remote WSMQ JMS Provider:</span>  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 12pt;">  </span></p><p><span lang="EN"><span style="font-size: 12pt;">   </span>  </span></p><p><?xml version="1.0" encoding="UTF-8"?></p><p><connection-factories></p><p><!-- The WSMQ JMS provider loader --></p><p><mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider"></p><p><attribute name="ProviderName">RemoteJMSProvider</attribute></p><p><attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute></p><p><attribute name="FactoryRef">remote/edb2pre1.que.mgr</attribute></p><p><attribute name="QueueFactoryRef">remote/edb2pre1.que.mgr</attribute></p><p><attribute name="TopicFactoryRef">remote/edb2pre1.que.mgr</attribute></p><p><depends>jboss.jndi:service=ExternalContext,jndiName=remote</depends></p><p></mbean></p><p><!-- Bind a remote IBM MQ server --></p><p><mbean code="org.jboss.naming.ExternalContext" name="jboss.jndi:service=ExternalContext,jndiName=remote"></p><p><attribute name="JndiName">remote</attribute></p><p><attribute name="Properties"></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></attribute></p><p><attribute name="InitialContext">javax.naming.InitialContext</attribute></p><p></mbean></p><p><span style="font-size: 12pt;"><span lang="EN"></span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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">  </span></span></p><p><span style="font-size: 12pt;"><span lang="EN">  </span></span></p><p><?xml version="1.0" encoding="UTF-8"?></p><p><server></p><p><mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=TestBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml"></p><p><depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends></p><p><depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends></p><p><attribute name="SourceDestinationLookup">/queue/TestQ</attribute></p><p><attribute name="TargetDestinationLookup">/remote/SS.GICSAW.FNBLIFE.REQUEST</attribute></p><p><attribute name="QualityOfServiceMode">0</attribute></p><p><attribute name="MaxBatchSize">5</attribute></p><p><attribute name="MaxBatchTime">1</attribute></p><p><attribute name="FailureRetryInterval">5000</attribute></p><p><attribute name="MaxRetries">-1</attribute></p><p><attribute name="AddMessageIDInHeader">false</attribute></p><p></mbean></p><p></server></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>