5 Replies Latest reply on Sep 21, 2006 12:04 AM by ovidiu.feodorov

    Problem with callbackURI

    coyotesqrl

      I've spent the last day and a half on this and only just figured out my
      problem a few moments ago. As I hadn't seen anything in the documentation or questions in the forums about it, I thought I'd post this in case anyone else encounters the same problem.

      I'm running 1.0.1_CR4 (had this problem with CR3 as well) and as soon as I'd put my server on another host from my client, began getting connection errors. I quickly realized that my server was reporting the loopback address as localhost, so I modified run.conf to include the java.rmi.server.hostname property.

      That allowed the initial connection to the server, but then after a period I'd get this error

      java.lang.RuntimeException: Failed to config client side AOP
       at org.jboss.jms.client.JBossConnectionFactory.ensureAOPConfigLoaded(JBossConnectionFactory.java:251)
       at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:196)
       at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:96)
       at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:91)
       at com.flc.utility.JMSHelper.run(JMSHelper.java:109)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for locator - InvokerLocator [socket://127.0.0.1:4457/?dataType=jms&marshaller=org.jboss.jms.server.remoting.JMSWireFormat&serializationtype=jboss&socket.check_connection=false&unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat]
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:318)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:116)
       at org.jboss.remoting.Client.invoke(Client.java:612)
       at org.jboss.remoting.Client.invoke(Client.java:604)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.invoke(ClientConnectionFactoryDelegate.java:198)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$getClientAOPConfig_8697532701842707646.invokeNext(ClientConnectionFactoryDelegate$getClientAOPConfig_8697532701842707646.java)
       at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPConfig(ClientConnectionFactoryDelegate.java)
       at org.jboss.jms.client.JBossConnectionFactory.ensureAOPConfigLoaded(JBossConnectionFactory.java:233)
       ... 5 more



      I finally realized that I needed to edit remoting-service.xml in the jboss-messaging SAR to change the serverBindAddress attribute to use the java.rmi.server.hostname property instead of jboss.bind.address.

      Now, maybe this is documented somewhere and I missed it, or maybe this is a problem with my linux box's configuration; however, it seemed pretty likely that others would suffer the same problem.

      I'm not sure if there's a better fix than this, but it's certainly not too painful for me.

        • 1. Re: Problem with callbackURI
          ovidiu.feodorov

          Thanks for report. I'll update the user documentation: http://jira.jboss.org/jira/browse/JBMESSAGING-528

          • 2. Re: Problem with callbackURI
            clebert.suconic

            I'm updating the documentation..

            But I just wonder why you didn't just use ./run.sh -b YourIP?

            • 3. Re: Problem with callbackURI
              coyotesqrl

              Ah. Like I said, I thought I might have just missed it.

              Clearly, that would be a preferable solution. Thanks for pointing out to me.

              • 4. Re: Problem with callbackURI
                clebert.suconic

                I'm adding this to the end of Chapter 6. If anyone wants to review it:

                6.5. Configuring the remoting connector

                JBoss Messaging uses JBoss Remoting for all client to server communication. For full details of what JBoss Remoting is capable of and how it is configured please consult the JBoss Remoting documentation.

                The default configuration includes a single remoting connector which is used by the single default connection factory. Each connection factory can be configured to use its own connector.

                The default connector is configured to use the remoting socket transport.

                This transport opens TCP connections from client to server for client to server communications (e.g. sending messages) and TCP connections from server to client for server to client communications (e.g. receiving messages). The transport can be configured to use SSL where a higher level of security is required.

                Future releases JBoss Messaging will support a bidirectional socket transport (similar to UIL2 in JBoss MQ) and an HTTP transport, both of which are useful in network environments where TCP connections from server to client are not possible. This means, for example, that you could deploy one connection factory that uses the HTTP transport for all the connections created from it, and another connection factory that uses the socket transport for all connections created from it.

                You can look at remoting configuration under:

                /server//deploy/jboss-messaging.sar/remoting-service.xml

                By default JBoss Messaging binds to ${jboss.bind.address} which can be defined by: ./run.sh -c -b yourIP.

                You can change remoting-service.xml if you want for example use a different communication port, or any other network behavior.


                6.6. Configuring the callback

                JBoss Messaging uses a callback mechanism from Remoting that needs a Socket for callback operations. These socket properties are passed to the server by a remote call when the connection is being estabilished. As we said before we will support bidirectional protocols in future releases.

                By default JBoss Messaging will execute InetAddress.getLocalHost().getHostAddress() to access your local host IP, but in case you need to setup a different IP, you can define a system property in your java arguments:

                Use java -Djboss.messaging.callback.bind.address=YourHost - That will determine the callBack host in your client.

                • 5. Re: Problem with callbackURI
                  ovidiu.feodorov

                  A couple of observations:

                  * This type of content should go to the Development list.


                  * Use the same path naming schema as everywhere else in the document, in situations like this:


                  You can look at remoting configuration under:

                  /server//deploy/jboss-messaging.sar/remoting-service.xml




                  * Add a few words about how to configure a custom port (http://jira.jboss.org/jira/browse/JBMESSAGING-431)