1 Reply Latest reply on Jan 22, 2009 4:48 PM by Ron Sigal

    Can't connect to JBoss Messaging behind firewall

    Ji-Woong Choi Newbie

      Hello, Team

      I'm testing on below configuration under firewall. The problem is that secondaryBindPort doesn't work on our configuration.

      JBoss Messaging : JBoss Messaging 1.4.0.SP3-CP04
      JBoss Remoting : JBoss remoting 2.2.2 SP-10

      Because I use the "ports-02" in sample-bindings.xml under docs/examples/binding-manager/, I appended these to the configuration file :

      <attribute name="secondaryBindPort">14000</attribute>
       <attribute name="secondaryConnectPort">14001</attribute>


      When I run client to JBoss Messaging over firewall, I've got this message :
      Exception in thread "main" java.lang.RuntimeException: Failed to download and/or install client side AOP stack
       at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:199)
       at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
       at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
       at com.jboss.jms.client.SimpleSender.send(SimpleSender.java:34)
       at com.jboss.jms.client.SimpleSender.main(SimpleSender.java:97)
      Caused by: org.jboss.jms.exception.MessagingNetworkFailureException
       at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:240)
       at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:205)
       at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:237)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDelegate.java)
       at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:75)
       at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
       ... 4 more
      Caused by: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [bisocket://mydomain.com:4657//?JBM_clientMaxPoolSize=200&clientLeasePeriod=10000&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowFactor=10&socket.check_connection=false&stopLeaseOnFailure=true&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&validatorPingPeriod=10000&validatorPingTimeout=4000]
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:579)
       at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:422)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
       at org.jboss.remoting.Client.invoke(Client.java:1634)
       at org.jboss.remoting.Client.invoke(Client.java:548)
       at org.jboss.remoting.Client.invoke(Client.java:536)
       at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)
       ... 9 more
      Caused by: java.net.NoRouteToHostException: No route to host
       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:520)


      I think this doesn't work with secondaryBindPort and secondaryConnectPort attributes.
      bisocket://mydomain.com:4657//?JBM_clientMaxPoolSize=200&clientLeasePeriod=10000&clientSocketClass=org.jboss.jms.client.remoting.ClientSocketWrapper&dataType=jms&marshaller=org.jboss.jms.wireformat.JMSWireFormat&numberOfCallRetries=1&numberOfRetries=10&pingFrequency=214748364&pingWindowFactor=10&socket.check_connection=false&stopLeaseOnFailure=true&timeout=0&unmarshaller=org.jboss.jms.wireformat.JMSWireFormat&validatorPingPeriod=10000&validatorPingTimeout=4000


      How do I solve this?

        • 1. Re: Can't connect to JBoss Messaging behind firewall
          Ron Sigal Master

          I'll explain the meaning of "secondaryBindPort" and "secondaryConnectPort", and maybe that will help.

          The Remoting bisocket transport creates two ServerSockets on the server. The "primary" ServerSocket is used to create connections used for ordinary invocations, e.g., a request to create a JMS consumer, and the "secondary" ServerSocket is used to create "control" connections for internal Remoting messages. The port for the primary ServerSocket is configured by the "serverBindPort" parameter, and the port for the secondary ServerSocket is, by default, chosen randomly.

          The "secondaryBindPort" parameter can be used to assign a specific port to the secondary ServerSocket. Now, if there is a translating firewall between the client and server, the client should be given the value of the port that is translated to the actual binding port of the secondary ServerSocket.

          For example, your configuration will tell the secondary ServerSocket to bind to port 14000, and it will tell the client to connect to port 14001. It assumes that there is a firewall which will translate 14001 to 14000. Apparently, that's not happening.

          Hope that helps.