Sorry! It is working.
I was just looking to another webbap path.

So this is the solution:
ObjectName name=new
ObjectName("Catalina:type=Manager,path=/NAME_OF_APP,host=localhost");
ManagementFactory.getPlatformMBeanServer().getAttribute(name,
"activeSessions");

However, is there any way to know which is the current webbap name (path)?
The only place I know I can find it is in the context, but as said, I don't
know how to get the context from an static method. Any help there?

On 19 May 2011 16:27, Mark Thomas <ma...@apache.org> wrote:

> On 19/05/2011 15:24, Mateu Yabar wrote:
> > What I have for now, after enableing JMX as descrived in
> > http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html
> >
> > I have the following code:
> > ObjectName name=new
> > ObjectName("Catalina:type=Manager,path=/test,host=localhost");
> > ManagementFactory.getPlatformMBeanServer().invoke(name, "listSessionIds",
> > null, null);
> >
> > But the invocation return an emtpy string.
>
> What happens when you try the same thing via JConsole? JConsole will
> also confirm you are using the right object name (it looks right to me).
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to