1 Reply Latest reply on May 9, 2006 4:39 PM by Tim O'Malley

    Getting http port in server.xml

    Tim O'Malley Newbie

      I have a web app deployed on jboss 4.0.2. Port 8080 is the http connector defined in C:\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\server.xml
      Is there a way to get that port information from my app?

        • 1. Re: Getting http port in server.xml
          Tim O'Malley Newbie

          FYI - I was able to get the port value with JMX:

          MBeanServer server = MBeanServerLocator.locateJBoss();
          QueryExp query = Query.and(Query.eq(Query.attr("secure"), Query.value(false)), Query.eq(Query.attr("protocol"), Query.value("HTTP/1.1")));
          Set ons = server.queryNames(null, query);
          Iterator i = ons.iterator();
          ObjectName objectName = (ObjectName)i.next();
          String port = objectName.getKeyProperty("port");
          System.out.println("port = " + port);