2 Replies Latest reply on Mar 14, 2011 4:19 AM by Wolf-Dieter Fink

    Could not obtain connection

    jagadesh manchala Newbie

      Hi ,

       

      I was trying to deploy an sample web application ,  i started the  server with ports-03.now i try to deploy the application using twiddle like

       

      twiddle.bat invoke "jboss.system:service=MainDeployer" deploy C:\software\DemoExample.war.

       

      the deployer was throwing an error saying

       

      org.jboss.util.NestedRuntimeException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error:javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]; - nested throwable: (javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]])

       

      why the server was trying to connect to localhost:1099 , when i started the server with ports-03.

       

      Even i was having the same issue while doing a shutdown of the servers ,i started 2 instances of servers like

       

      run.sh -C node2 -Djboss.service.binding.set=ports-03 -b hostName

      run.sh -C node1-b hostName (both the ports are different)


      so the node1 will use the default ports and node2 will use ports-03.when i tried to shutdown the server using

       

      shutdown.sh -S node2 -Djboss.service.binding.set=ports-03 , it was throwing the same exception as above saying unable to connect to localhost:1099.

       

      is there any way that i can say to deployer to connect to jmx using this port OR can i say to shutdown.sh saying the port for jmx is this.Iam using Jboss AS 5

       

       

      Thanks in advance for all the advices and suggestions.

       



       


        • 1. Re: Could not obtain connection
          jagadesh manchala Newbie

          OK , i got the answer (i think so)

           

          now i can stop the server like ,

           

          shutdown.bat -s localhost:1399 <Server Name> -u <User Name> -p <Password>

           

          and also i can deploy the application using twiddle like

           

          twiddle.bat -s localhost:1099 invoke  "jboss.system:service=MainDeployer" deploy C:\software\DemoExample.war(which returned a null and i need to test)

           

          but why there is a need to give the jmx port for shutdown a server. why is the server cant get the ports with which the server is started.

           

           

          Any suggestions ?

           

           


           


          • 2. Could not obtain connection
            Wolf-Dieter Fink Master

            The script, or even the java program, need to know what the configuration (ports) of your server.

             

            Because there are many posibilities how to change ports and IP binding it is difficult to get the right configuration out of the configuration files , but indeed not impossible.

            Also you might able to use twiddle from remote.