Hi,
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 ?
I think you simply have the wrong MBean. There's ones for Tomcat:
http://www.opennms.org/index.php/Tomcat_5.5_JMX_How-To