11 Replies Latest reply on Feb 14, 2019 8:20 AM by rasras

    Failed to connect to localhost:1099

    rasa

      Hi,

      I am using jboss 3.2.5 application server for my application and its working fine. But recently my admin configured the same in some other machine and he can able to start the server using run script, when he tries for stop by using ./shutdown.sh -S it gives following error.

      ./shutdown.sh -S
      16:40:19,463 WARN [NamingContext] Failed to connect to localhost:1099
      javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:213)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1185)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.Shutdown.main(Shutdown.java:188)
      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)
      ... 5 more
      Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:464)
      at java.net.Socket.connect(Socket.java:414)
      at java.net.Socket.(Socket.java:310)
      at java.net.Socket.(Socket.java:212)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:183)
      ... 5 more
      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1198)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.Shutdown.main(Shutdown.java:188)

      I tried telnet localhost 1099, its not working. gives connection refused error. So anything wrong in jboss configuration. Please help me to find a solution.

      Thanks And Regards
      Rasa

        • 1. Re:  Failed to connect to localhost:1099
          peterj

          Apparently JBoss AS is configured to use a port other than 1099 for JNDI. You need to supply that port number, example:

          ./shutdown.sh -S -s localhost:9999

          • 2. Re:  Failed to connect to localhost:1099
            rasa

            Ok Thansks. What is the default port and normally where it is configured.


            <!-- The listening port for the bootstrap JNP service. Set this to -1
            to run the NamingService without the JNP invoker listening port.
            -->
            1099
            <!-- The bootstrap JNP server bind address. This also sets the default
            RMI service bind address. Empty == all addresses

            is it here in jboss-service.xml.

            Thanks and Regards
            Rasa

            • 3. Re:  Failed to connect to localhost:1099
              peterj

              The JNDI port is defined in jboss-service.xml, unless the binding manager service is being used - see the ServiceBindingManager mbean in the same file.

              P.S. Wrap XML text with code tags - select the text and click the Code button above the editor window - and use the Preview button to ensure that your post is properly formatted before submitting it.

              1 of 1 people found this helpful
              • 4. Re:  Failed to connect to localhost:1099
                rasa

                first up on sorry for not formatting the code. Thanks for your kind attention. As you told i checked jboss-service.xml in that the specified mbean ServiceBindingManager is commented. So i think its not being used in my apps.

                But still when i gives ./shutdown.sh -S i gets the same error. The admin configured 3 server and there its working fine. So wht else i need to check ??


                Thanks And Regards
                Rasa

                • 5. how to access joboss portal through ip address
                  akumarkind

                  Hi Alll

                  I am not enable to access jboss portal through IP address on various computer which are on my network(LAN).Means I want to access portal by http://192.168.1.150:9090/portal instant of http://localhost:9090/portal.
                  Please help me.

                  Thanks & Regards

                  Avanish Kumar

                  • 6. Re: how to access joboss portal through ip address
                    jaikiran

                     

                    "akumarkind" wrote:
                    Hi Alll

                    I am not enable to access jboss portal through IP address on various computer which are on my network(LAN).Means I want to access portal by http://192.168.1.150:9090/portal instant of http://localhost:9090/portal.
                    Please help me.

                    Thanks & Regards

                    Avanish Kumar


                    Avanish,

                    You should have created a separate thread in an appropriate forum instead of replying to a post which is trying to address a different issue.

                    As for your issue, see this http://jboss.org/community/docs/DOC-10179. If you have more questions, please open a new thread in appropriate forum :)

                    • 7. Re:  Failed to connect to localhost:1099
                      peterj

                      See if this discussion helps: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4121889

                      Pay special attention to the 'telnet' suggestion.

                      • 8. Re:  Failed to connect to localhost:1099
                        rasa

                        hi,

                        Thanks for your kind attention.

                        M jboss-service.xml is was as giiven below

                        <mbean code="org.jboss.naming.NamingService"
                         name="jboss:service=Naming">
                         <!-- The listening port for the bootstrap JNP service. Set this to -1
                         to run the NamingService without the JNP invoker listening port.
                         -->
                         <attribute name="Port">1098</attribute>
                         <!-- The bootstrap JNP server bind address. This also sets the default
                         RMI service bind address. Empty == all addresses
                        


                        then i was getting above mentioned error. So i thought may be jboss is internally refering port 1099 when i use shutdown.sh. So i had changed it. But i didnt restarted jboss. But again i tried ./shutdown.sh -S , still its showing the error.

                        telnet 1098 is working fine but telnet 1099 is giving following error
                        Trying 127.0.0.1...
                        telnet: connect to address 127.0.0.1: Connection refused
                        telnet: Unable to connect to remote host: Connection refused

                        If i will make it as 1098 in jboss-service.xml where else i need to change.

                        Please help me to find a solution

                        Thanks and Regards
                        Rasa



                        • 9. Re:  Failed to connect to localhost:1099
                          rasa

                          The error which i gets in the console is

                          18:23:26,502 WARN [NamingContext] Failed to connect to localhost:1099
                          javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
                          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:213)
                          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1185)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
                          at javax.naming.InitialContext.lookup(InitialContext.java:347)
                          at org.jboss.Shutdown.main(Shutdown.java:188)
                          Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
                          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)
                          ... 5 more
                          Caused by: java.net.ConnectException: Connection refused
                          at java.net.PlainSocketImpl.socketConnect(Native Method)
                          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                          at java.net.Socket.connect(Socket.java:464)
                          at java.net.Socket.connect(Socket.java:414)
                          at java.net.Socket.(Socket.java:310)
                          at java.net.Socket.(Socket.java:212)
                          at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
                          at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
                          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:183)
                          ... 5 more
                          Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099
                          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1198)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516)
                          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
                          at javax.naming.InitialContext.lookup(InitialContext.java:347)
                          at org.jboss.Shutdown.main(Shutdown.java:188)

                          • 10. Re:  Failed to connect to localhost:1099
                            peterj

                            What results do you get from running:

                            netstat -np | grep java

                            • 11. Re:  Failed to connect to localhost:1099
                              rasras

                              Hello All,

                               

                              I also faced the same issue. Solutions posted above could not help me much.

                              So I got to know about the actual JNP Port by some other mechanism. Posting it here might help someone else.

                               

                              I accessed JMX-Console via my JBOSS Home Page & then navigated through jboss --> Service=Naming --> Attributes table --> NamingProxy & Port. Refer to the screenshot below:

                               

                               

                              Thanks,

                              RAS