jboss.system:service=Server provides a StartDate. You could subtract that from the current date/time to get uptime.
cheers for that.
i have used the jboss.system:service=Server to find the jboss start date. but i get MBean exception. how to resolve this problem?
My code looks like,
RMIAdaptor jbossServer = (RMIAdaptor) ctx.lookup("jmx/invoker/RMIAdaptor");
ObjectName mgr = new ObjectName("jboss.system:service=Server");
Object newObj = jbossServer.invoke(mgr, "getStartDate", null, null);
Am I missing out something? Please help.
i need to find the Jboss uptime.
Thanks in advance.
Try to read that as an attribute instead of invoking an operation.
Thanks a lot for the reply.
I tried to read it as an attribute, but i get the Exception - InstanceNotFoundException.
It says that the jboss.system:service=Server is not registered.
How will I handle this situation?
You will use the correct name: 'jboss.system:type=Server'
If you need view uptime from shell use twiddle.sh..