2 Replies Latest reply on Feb 4, 2008 1:14 AM by yongheo

    IP binding problem

    yongheo

      Hi, I have a problem with binding data source.
      Can anyone help me?

      I have a web application which runs on JBoss with postgresql database server.
      It works fine when I run the JBoss with localhost.
      Then, I started jboss application server with IP binding option.
      run.sh -b 128.173.23.123
      And when it try to connect to database, it gave me below errors.

      Unable to locate data source; 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]

      I don't see above problem when I start JBoss without IP binding option.
      Does anyone know why? And how to solve the problem?
      Thanks in advance.

        • 1. Re: IP binding problem
          jaikiran

          Post the entire exception stacktrace. When does this exception occur? Does it happen when you are doing a lookup of the datasource and trying to obtain a connection from it? If yes, then have you specified the PROVIDER_URL as 128.173.23.123 to the InitialContext (since the services are longer binded to localhost):

          Properties props = new Properties();
          props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          props.put(Context.PROVIDER_URL,"jnp://128.173.23.123:1099");
          Context ctx = new InitialContext(props);
          ctx.lookup("blahblahblah");


          • 2. Re: IP binding problem
            yongheo

            Wow, jaikiran

            Thanks alot. Yeah, you are right. I have to modify the Context part.
            Quick reply solves the problem in short time.
            Thank you very much.

            Cheers,
            Yong