1 2 Previous Next 21 Replies Latest reply on May 9, 2008 12:51 AM by priyarao234 Go to original post
      • 15. Re: How to access JBOSS by providing IP address
        priyarao234

        ThankQ marie123, i'm getting the following error....

        javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.116.25.23: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 192.116.25.23:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.116.25.23:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.v2.eclinic.ConcernedDeptDoctor.(ConcernedDeptDoctor.java:103)
        at com.v2.eclinic.ConcernedDeptDoctor.main(ConcernedDeptDoctor.java:179)
        Caused by: javax.naming.CommunicationException: Failed to connect to server192.116.25.23:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.116.25.23:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
        ... 5 more
        Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 192.116.25.23:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
        ... 6 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:364)
        at java.net.Socket.connect(Socket.java:507)
        at java.net.Socket.connect(Socket.java:457)
        at java.net.Socket.(Socket.java:365)
        at java.net.Socket.(Socket.java:265)
        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:239)


        .........................................

        i'm getting the above error when i tried to configure jndi in my application like below...

        env.put(Context.INITIAL_CONTEXT_FACTORY,
        "org.jnp.interfaces.NamingContextFactory");
        env.put(Context.URL_PKG_PREFIXES,
        "=org.jboss.naming:org.jnp.interfaces");
        env.put(Context.PROVIDER_URL, "jnp://192.116.25.23");


        So plz tell me how 2 solve this problem.... in simple how to access the server which is running in a remote machine in my application by configuring the jndi configuration like above................... or any other way is appriciated





        • 16. Re: How to access JBOSS by providing IP address
          jaikiran

          Priya,

          As has been explained various times in this thread, you have to start the server with -b 0.0.0.0 or -b 192.116.25.23 for this piece of code to work. When you are running this piece of code, how did you start the server? What did you pass to the -b option? If you used the correct -b parameter value, then make sure that the remote system 192.116.25.23 is accessible from the client machine. What does the following command from the client system, output:

          telnet 192.116.25.23 1099


          • 17. Re: How to access JBOSS by providing IP address
            priyarao234

            thanks Kiran, dats fine but what i want is how to configure that remote server in my jndi.properties file........... dats wt i want exactly............

            • 18. Re: How to access JBOSS by providing IP address
              aneesh62003

              Hi Priya..
              Did u try to telnet from ur remote machine to the server in that port.

              You dont have to change ur server jndi properties.

              First verify your server jndi is on that port 1099

              then try to telnet from the local machine and from the remote machine to that port...

              • 19. Re: How to access JBOSS by providing IP address
                priyarao234

                ThankQ Aneesh,

                when i'm trying to connect by typing telnet 192.116.25.23 1099 on commandprompt it showing the following error.....

                Connecting To 192.116.25.23...Could not open connection to the host, on port 1099: Connect failed

                • 20. Re: How to access JBOSS by providing IP address
                  aneesh62003

                  Try to do telnet from the same machine in which server is

                  try 192.116.25.23 1009
                  and localhost 1099

                  If both works check whether u can ping from remote to the server machine.
                  else
                  check whether your jndi is bound to 1099?



                  • 21. Re: How to access JBOSS by providing IP address
                    priyarao234

                    Hi Aneesh thankQ.... I'm having one more doubt regarding JMS.. i.e
                    i'm using JBOSSMQ as JMS Provider and in my publisher program i'm using PERSISTENT like below.... but while running the consumer program the same message is at first time and that is fine.. and i'm closing the consumer program and then again i' running the consumer program but the same message is again consumed. But actually ones the message is consumed after that it has to be expired so please provide the solution...and how the publisher program knows that the message was consumed or not ? plz fell free to giv reply..
                    publisher.publish(msg,
                    javax.jms.DeliveryMode.PERSISTENT,
                    javax.jms.Message.DEFAULT_PRIORITY, 0);

                    1 2 Previous Next