0 Replies Latest reply on Nov 25, 2007 8:28 PM by leifoo

    JBM-1.4.0.SP1 Bridge Deploy/Undeploy Issues

    leifoo

      Hello,

      #JBMESSAGING-999 now works, but I run into a problem when I un-deploy a bridge service after stopping the "remote" node.

      The scenario:

      Start two nodes, node0 and node1.
      Deploy Remote JMS-DS and Bridge Service on node0
      Stop node1. The bridge service detects that node1 is unavailable.
      Un-deploy Remote JMS-DS and Bridge Service. It seems that the bridge service is not completly un-deployed and tries to connect to node1 even if the service is un-deployed(stopped). This is the output from node0:


      02:21:20,671 INFO [BridgeService] Started bridge BridgeService. Source: /queue/A Target: /queue/A
      02:21:28,640 ERROR [SocketClientInvoker] Got marshalling exception, exiting
      java.io.IOException: Connection reset by peer: socket write error
       at java.net.SocketOutputStream.socketWrite0(Native Method)
       at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
       at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
       at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
       at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
       at java.io.DataOutputStream.flush(DataOutputStream.java:106)
       at org.jboss.jms.wireformat.SerializedPacket.write(SerializedPacket.java:81)
       at org.jboss.jms.wireformat.JMSWireFormat.write(JMSWireFormat.java:237)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedWrite(MicroSocketClientInvoker.java:983)
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:559)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:413)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
       at org.jboss.remoting.ConnectionValidator.doCheckConnection(ConnectionValidator.java:133)
       at org.jboss.remoting.ConnectionValidator.run(ConnectionValidator.java:308)
       at java.util.TimerThread.mainLoop(Timer.java:512)
       at java.util.TimerThread.run(Timer.java:462)
      02:21:28,640 WARN [Bridge] Detected failure on connection
      javax.jms.JMSException: Failure on underlying remoting connection
       at org.jboss.jms.client.remoting.ConsolidatedRemotingConnectionListener.handleConnectionException(ConsolidatedRemotingConnectionListener.java:102)
       at org.jboss.remoting.ConnectionValidator$1.run(ConnectionValidator.java:452)
      02:21:40,656 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:21:40,703 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.rollbackxaerror] [com.arjuna.ats.internal.jta.resources.arjunacore.rollbackxaerror] XAResourceReco
      rd.rollback - xa error XAException.XAER_NOTA
      02:21:40,703 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_54] - Top-level abort of action -3f57fe97:5db:474a1955:a6 received TwoPhaseOutcome.FINISH_ERROR fr
      om <ClassName:RecordType.JTA_RECORD>
      02:21:40,703 INFO [BridgeService] Stopped bridge BridgeService
      02:21:50,718 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:22:00,781 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:22:10,828 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:22:18,875 WARN [Client] unable to remove remote callback handler: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.
      0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWire
      Format&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowFactor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFor
      mat]
      02:22:20,890 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:22:28,843 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed sending disconnect for client le
      ase for client with session ID 5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1o
      02:22:30,843 WARN [LeasePinger] LeasePinger[SocketClientInvoker[1933eab, bisocket://127.0.0.1:4557](5c4o12x-l5758i-f9gafm8t-1-f9gbdsk1-1p)] failed to ping to server: Can not get c
      onnection to server. Problem establishing socket connection for InvokerLocator [bisocket://127.0.0.1:4557/?clientLeasePeriod=10000&clientMaxPoolSize=200&clientSocketClass=org.jboss
      .jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowF
      actor=10&socket.check_connection=false&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat]
      02:22:38,890 ERROR [MicroRemoteClientInvoker] error shutting down lease pinger
      02:22:38,890 ERROR [ClosedInterceptor] ClosedInterceptor.ClientSessionDelegate[u1-clsdbg9f-1-t8mfag9f-i8575l-x21o4c5]: method getXAResource() did not go through, the interceptor is
       CLOSED
      02:22:38,890 WARN [Bridge] Will retry after a pause of 5000 ms
      02:22:44,828 WARN [Bridge] Failed to set up connections
      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1199 [Root exception is javax.naming.CommunicationException: Failed to connect to s
      erver localhost:1199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1199 [Root exception is java.net.ConnectException: Connectio
      n refused: connect]]]
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)
       at org.jboss.jms.server.bridge.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:45)
       at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:910)
       at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1152)
       at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)
       at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1507)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1199 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server
      localhost:1199 [Root exception is java.net.ConnectException: Connection refused: connect]]
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
       ... 10 more
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1199 [Root exception is java.net.ConnectException: Connection refused: connect]
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
       ... 11 more
      Caused by: java.net.ConnectException: Connection refused: connect
       at java.net.PlainSocketImpl.socketConnect(Native Method)
       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
       at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
       at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
       at java.net.Socket.connect(Socket.java:519)
       at java.net.Socket.connect(Socket.java:469)
       at java.net.Socket.<init>(Socket.java:366)
       at java.net.Socket.<init>(Socket.java:267)
       at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
       at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)
       ... 11 more
      02:22:44,843 ERROR [ClosedInterceptor] ClosedInterceptor.ClientSessionDelegate[u1-clsdbg9f-1-t8mfag9f-i8575l-x21o4c5]: method getXAResource() did not go through, the interceptor is
       CLOSED
      02:22:44,843 WARN [Bridge] Failed to set up connections, will retry after a pause of 5000 ms
      02:22:50,765 WARN [Bridge] Failed to set up connections



      Everything works as expected if I un-deploy while both nodes are running.


      The remote ds:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <connection-factories>
      
       <!-- The Remote JMS provider loader -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">
       <attribute name="ProviderName">MyRemoteJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">/XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">/XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">/XAConnectionFactory</attribute>
       <!-- Access JMS via HAJNDI -->
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1199
       jnp.disableDiscovery=true
       </attribute>
       </mbean>
      </connection-factories>
      



      The bridge service:
      <?xml version="1.0" encoding="UTF-8"?>
      <!--
       Example deployment descriptor for a message bridge
       $Id: messaging-secure-socket-service.xml 2737 2007-05-29 17:56:49Z timfox $
       -->
      
      <server>
      
       <mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=TestBridge"
       xmbean-dd="xmdesc/Bridge-xmbean.xml">
      
       <!-- The JMS provider loader that is used to lookup the source destination -->
       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
       <!-- The JMS provider loader that is used to lookup the target destination -->
       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends>
      
       <!-- The JMS provider loader that is used to lookup the source destination
       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=HAJNDIJMSProvider</depends>
       -->
       <!-- The JMS provider loader that is used to lookup the target destination
       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=HAJNDIJMSProvider</depends>
       -->
      
      
       <!-- The JNDI lookup for the source destination -->
       <attribute name="SourceDestinationLookup">/queue/A</attribute>
      
       <!-- The JNDI lookup for the target destination -->
       <attribute name="TargetDestinationLookup">/queue/A</attribute>
      
       <!-- The username to use for the source connection
       <attribute name="SourceUsername">bob</attribute>
       -->
      
       <!-- The password to use for the source connection
       <attribute name="SourcePassword">cheesecake</attribute>
       -->
      
       <!-- The username to use for the target connection
       <attribute name="TargetUsername">mary</attribute>
       -->
      
       <!-- The password to use for the target connection
       <attribute name="TargetPassword">hotdog</attribute>
       -->
      
       <!-- Optional: The Quality Of Service mode to use, one of:
       QOS_AT_MOST_ONCE = 0;
       QOS_DUPLICATES_OK = 1;
       QOS_ONCE_AND_ONLY_ONCE = 2; -->
       <attribute name="QualityOfServiceMode">2</attribute>
      
       <!-- JMS selector to use for consuming messages from the source
       <attribute name="Selector">specify jms selector here</attribute>
       -->
      
       <!-- The maximum number of messages to consume from the source before sending to the target -->
       <attribute name="MaxBatchSize">5</attribute>
      
       <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded.
       -1 means wait forever -->
       <attribute name="MaxBatchTime">-1</attribute>
      
       <!-- If consuming from a durable subscription this is the subscription name
       <attribute name="SubName">mysub</attribute>
       -->
      
       <!-- If consuming from a durable subscription this is the client ID to use
       <attribute name="ClientID">myClientID</attribute>
       -->
      
       <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
       <attribute name="FailureRetryInterval">5000</attribute>
      
       <!-- The maximum number of connection retries to make in case of failure, before giving up
       -1 means try forever-->
       <attribute name="MaxRetries">-1</attribute>
      
       <!-- If true then the message id of the message before bridging will be added as a header to the message so it is available
       to the receiver. Can then be sent as correlation id to correlate in a distributed request-response -->
       <attribute name="AddMessageIDInHeader">false</attribute>
      
       </mbean>
      
       </server>
      



      Regards
      Leif Olsen

      My environment:
      WinXP
      jdk1.6.0
      jboss-4.2.2.GA
      MySql5
      jboss-messaging-1.4.0.SP1
      jboss-remoting 2.2.2.SP1