3 Replies Latest reply on May 9, 2006 4:32 PM by tomalley

    How can I find Tomcat Port

    asafz

      How can I find the Tomcat Http Port from the jmx-console?

      I searched in jboss.web but I cannot find Mbean with Port attribute.

      I dont want to use the Mbean name (name=http-0.0.0.0-8080,type=GlobalRequestProcessor ) to find the Http port.

      I want to Query a lot of jboss instances and find their Tomcat port so I need to find a generic Mbean (with standard ObjectName) who define the Http Port.

      My second Question is can I change the Tomcat Http Port Online with the jmx-console and if so how?

      thanx,

        • 1. Re: How can I find Tomcat Port
          tomalley

          I am researching the same issue. Did you ever find answers to your questions?

          • 2. Re: How can I find Tomcat Port
            asafz


            NO, I'm still dont have a clue.

            if you find the answer please let me know.

            thanx.

            • 3. Re: How can I find Tomcat Port
              tomalley

              The port is found in jboss.web:type=Connector,*
              There are 3 connectors defined by default so query for protocol=HTTP/1.1 and secure=false (http) or secure=true (https).

              MBeanServer server = MBeanServerLocator.locateJBoss();
              QueryExp query = Query.and(Query.eq(Query.attr("secure"), Query.value(secure)), Query.eq(Query.attr("protocol"), Query.value(protocol)));
              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);
              


              I don't know if it can be modified.