1 Reply Latest reply on Oct 25, 2007 12:46 PM by Elias Ross

    JBoss App Server Port Number

    Ron Turner Newbie

      Iam using JBoss server 4.0.5.
      Iam trying to use JMX to internally get the servers port number.
      The port number i am looking for is the one configured in the
      server.xml file:

      <Connector port="8080" ...../>

      How would programmatically get this port number?
      I can get some port info using the following code:

      RMIAdaptor server = (RMIAdaptor)ctx.lookup("jmx/rmi/RMIAdaptor");
      ObjectName name = new ObjectName("jboss:readonly=true,service=invoker,target=Naming,type=http");
      String invokerString = (String)server.getAttribute(name, "InvokerURLSuffix");

      I then parse out the port number.
      But this port number is not neccesarily the one in the server.xml file.
      Any ideas ?