3 Replies Latest reply on Jul 1, 2008 6:54 PM by 666705

    How to figure out port number in weblogic 9.2?

    666705
      I need to figure out the port number and ipaddress of the box where my server is running, from within the weblogic 9.2
      I found several ways of doing that on the previous versions of weblogic, using these newsgroups. However, I did not find anything recent, and nothing about weblogic 9.2
      The old wyas of doing that do not work for me.

      Any advice?
        • 1. Re: How to figure out port number in weblogic 9.2?
          666705
          I looked for this information in ServletConfig, in ServletContext, in JVMID

          ServletConfig or ServletContext do not have anything (at least I do not see anything),

          The newsgroups recommend the following code

          public static String getLocalUrlString()
          {
          String urlString;
          JVMID jvmid = JVMID.localID();
          urlString = jvmid.getHostAddress();
          weblogic.rjvm.Protocol proto
          =weblogic.rjvm.Protocol.getDefaultProtocol();
          int port = jvmid.getPort(proto);
          return urlString + ISoapConstants.SCHEME_DELIMITER + port;
          }

          I also tried

          weblogic.rjvm.Protocol does not exist in current version, and I did not get any real information inside JVMID

          Also tried JVMID.localID().ports(), which returns null

          System.getProperty("weblogic.system.bindAddr"); or weblogic.system.listenPort property,

          getProperty returns null

          Tried also another approach from the newsgroups - JwsContext.

          ...
          /** @common:context */
          JwsContext context;
          ...
          String myPort = context.getService().getURL().getPort();
          String myUrl = context.getService().getURL().toString();

          context is null

          None of them worked.

          Do you have any other ideas?

          All those ideas I found in the newsgroups were to the previos version(s) of weblogic - up to 8.1. I have not found anything specific to 9.2
          • 2. Re: How to figure out port number in weblogic 9.2?
            666705
            Login to Weblogic console. At the top left corner, click the Change Center > Lock & Edit. Under Domain Structure, click Environment > Servers. On the right window, click Congiguration Tab > General option. You will see the server port and Ip address. Hope this help.

            Mikew
            • 3. Re: How to figure out port number in weblogic 9.2?
              666705
              Any luck figuring this out? i need to get the same info during servlet init.