<!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;">
Unable to publish after remote JBoss JMS restart
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/cschmidt001">Carl Schmidt</a> in <i>JBoss Messaging</i> - <a href="http://community.jboss.org/message/593617#593617">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hello all, </p><p>  I've been searching quite a bit for a solution to this problem, and would appreciate any assistance, TIA.  I have a local durable MDB consuming messages from a local topic, then publishing them to a topic on a remote jboss messaging instance.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>If I shut down the remote jboss instance, I get the expected warning in the local jboss logs:  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><code></code></p><p><code>011-03-16 21:55:18,774 TRACE [org.jboss.jms.server.endpoint.ServerSessionEndpoint] (WorkManager(2)-4) SessionEndpoint[rc-kpow0dlg-1-zw6v0dlg-tyrpht-04v2gs4] acknowledging transactionally 1 messages for TX(21304556237193217):ACTIVE</code></p><p><code>2011-03-16 22:00:35,518 WARN  [org.jboss.resource.adapter.jms.JmsManagedConnection] (Thread-38) Handling jms exception failure: org.jboss.resource.adapter.jms.JmsManagedConnection@1f6d10f</code></p><p><code>javax.jms.JMSException: Failure on underlying remoting connection</code></p><p><code>at org.jboss.jms.client.remoting.ConsolidatedRemotingConnectionListener.handleConnectionException(ConsolidatedRemotingConnectionListener.java:102)</code></p><p><code>at org.jboss.remoting.ConnectionValidator$1.run(ConnectionValidator.java:744)</code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Attempting to publish messages to the remote topic throws the following exception after each retry:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><code></code></p><p><code>2011-03-16 22:01:53,985 ERROR [org.jboss.messaging.util.ExceptionUtil] (WorkManager(2)-5) SessionEndpoint[wd-9u4b1dlg-1-zw6v0dlg-tyrpht-04v2gs4] createTopic [yd-9u4b1dlg-1-zw6v0dlg-tyrpht-04v2gs4]</code></p><p><code>javax.jms.JMSException: There is no administratively defined topic with name:pendingBatching</code></p><p><code>          at org.jboss.jms.server.endpoint.ServerSessionEndpoint.createTopic(ServerSessionEndpoint.java:323)</code></p><p><code>          at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$createTopic$aop(SessionAdvised.java:110)</code></p><p><code>          at org.jboss.jms.server.endpoint.advised.SessionAdvised$createTopic_N1144803973659535745.invokeTarget(SessionAdvised$createTopic_N1144803973659535745.java)</code></p><p><code>          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)</code></p><p><code>          at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)</code></p><p><code>          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)</code></p><p><code>          at org.jboss.jms.server.endpoint.advised.SessionAdvised.createTopic(SessionAdvised.java)</code></p><p><code>          at org.jboss.jms.wireformat.SessionCreateTopicRequest.serverInvoke(SessionCreateTopicRequest.java:74)</code></p><p><code>          at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)</code></p><p><code>          at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)</code></p><p><code>          at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)</code></p><p><code>          at org.jboss.remoting.Client.invoke(Client.java:1724)</code></p><p><code>          at org.jboss.remoting.Client.invoke(Client.java:629)</code></p><p><code>          at org.jboss.remoting.Client.invoke(Client.java:617)</code></p><p><code>          at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)</code></p><p><code>          at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)</code></p><p><code>          at org.jboss.jms.client.delegate.ClientSessionDelegate.org$jboss$jms$client$delegate$ClientSessionDelegate$createTopic$aop(ClientSessionDelegate.java:353)</code></p><p><code>          at org.jboss.jms.client.delegate.ClientSessionDelegate$createTopic_N1144803973659535745.invokeTarget(ClientSessionDelegate$createTopic_N1144803973659535745.java)</code></p><p><code>          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)</code></p><p><code>          at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:92)</code></p><p><code>          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)</code></p><p><code>          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)</code></p><p><code>          at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)</code></p><p><code>          at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)</code></p><p><code>          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)</code></p><p><code>          at org.jboss.jms.client.delegate.ClientSessionDelegate.createTopic(ClientSessionDelegate.java)</code></p><p><code>          at org.jboss.jms.client.JBossSession.createTopic(JBossSession.java:260)</code></p><p><code>          at org.jboss.resource.adapter.jms.JmsSession.createTopic(JmsSession.java:334)</code></p><p><code>          at com.companyName.appName.service.mdb.OutboundOrderListener.onMessage(OutboundOrderListener.java:35)</code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But once I restart the remote jboss instance, I _still_ get the above exception each time the local MDB tries to publish to the remote topic. Additional details follow:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBoss 5.1.0</p><p>Jboss Messaging 1.4.3</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>jms-ds.xml </p><p><code></code></p><p><code> <tx-connection-factory></code></p><p><code>      <jndi-name>XADefaultJMSProviderremoteJboss</jndi-name></code></p><p><code>      <xa-transaction/></code></p><p><code>      <rar-name>jms-ra.rar</rar-name></code></p><p><code>      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition></code></p><p><code>      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property></code></p><p><code>      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/remoteJbossJMS</config-property></code></p><p><code>      <max-pool-size>1</max-pool-size></code></p><p><code>      <depends>jboss.messaging:service=ServerPeer</depends></code></p><p><code>   </tx-connection-factory></code></p><p><code><br/></code></p><p><code>   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"</code></p><p><code>          name="jboss.messaging:service=JMSProviderLoader,name=remoteJbossJMS"></code></p><p><code>      <attribute name="ProviderName">remoteJbossJMS</attribute></code></p><p><code>      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute></code></p><p><code>      <attribute name="FactoryRef">java:/XAConnectionFactory</attribute></code></p><p><code>      <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute></code></p><p><code>      <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute></code></p><p><code>            <attribute name="Properties"></code></p><p><code>       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory</code></p><p><code>       java.naming.factory.url.pkgs=org.jnp.interfaces</code></p><p><code>       java.naming.provider.url=jnp://foo.dev.remoteJboss.companyName-inc.com:1099</code></p><p><code>      </attribute></code></p><p><code>   </mbean></code></p><p><code><br/></code></p><p><code><br/></code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The mdb:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><code></code></p><p><code>package com.companyName.appName.service.mdb;</code></p><p><code><br/></code></p><p><code><br/></code></p><p><code>import javax.annotation.Resource;</code></p><p><code>import javax.ejb.ActivationConfigProperty;</code></p><p><code>import javax.ejb.MessageDriven;</code></p><p><code>import javax.jms.Connection;</code></p><p><code>import javax.jms.ConnectionFactory;</code></p><p><code>import javax.jms.JMSException;</code></p><p><code>import javax.jms.Message;</code></p><p><code>import javax.jms.MessageListener;</code></p><p><code>import javax.jms.MessageProducer;</code></p><p><code>import javax.jms.Session;</code></p><p><code>import javax.jms.Topic;</code></p><p><code><br/></code></p><p><code><br/></code></p><p><code>@MessageDriven(activationConfig = {</code></p><p><code>        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),</code></p><p><code>        @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "OutboundOrderListenerSubscription"),</code></p><p><code>        @ActivationConfigProperty(propertyName = "clientId", propertyValue = "OutboundOrderListener"),</code></p><p><code>        @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/orderBatchesBoundForOS"),</code></p><p><code>        @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),</code></p><p><code>        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })</code></p><p><code>public class OutboundOrderListener implements MessageListener{</code></p><p><code><br/></code></p><p><code><br/></code></p><p><code>          @Resource(mappedName = "java:XADefaultJMSProviderremoteJboss")</code></p><p><code>          private ConnectionFactory connectionFactory;</code></p><p><code><br/></code></p><p><code>          @Override</code></p><p><code>          public void onMessage(Message message) {</code></p><p><code>                    Connection connection = null;</code></p><p><code>                    boolean sendOrderException = false;</code></p><p><code>                    try {</code></p><p><code>                              connection = connectionFactory.createConnection();</code></p><p><code>                              Session session = connection.createSession(false,</code></p><p><code>                                                  Session.AUTO_ACKNOWLEDGE);</code></p><p><code>                              Topic topic = session.createTopic("pendingBatching");</code></p><p><code>                              MessageProducer publisher = session.createProducer(topic);</code></p><p><code>                              publisher.send(message);</code></p><p><code>                    } catch (JMSException e) {</code></p><p><code>                              sendOrderException = true;</code></p><p><code>                              // re-throw as run time exception because it indicates an</code></p><p><code>                              // unrecoverable error</code></p><p><code>                              throw new RuntimeException(e);</code></p><p><code>                    } finally {</code></p><p><code>                              try {</code></p><p><code>                                        if (connection != null) {</code></p><p><code>                                                  connection.close();</code></p><p><code>                                        }</code></p><p><code>                              } catch (JMSException e) {</code></p><p><code>                                        if (!sendOrderException) {</code></p><p><code>                                                  // re-throw as run time exception only if sending message</code></p><p><code>                                                  // didn't cause one</code></p><p><code>                                                  throw new RuntimeException(e);</code></p><p><code>                                        }</code></p><p><code>                              }</code></p><p><code>                    }</code></p><p><code><br/></code></p><p><code>          }</code></p><p><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/593617#593617">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>