The CMS Service is a MBean service, it is also registered in JNDI under the name "java:portal/CMS"
You can access it like this:
Context ctx = new InitialContext(); CMS cmsService = (CMS)ctx.lookup("java:portal/CMS");
This code should work for 2.6, the interface and JNDI name may be different in 2.2 though.
Thanks for your fast answer.
The interface name is correct for 2.2 but it looks like the JNDI name is not.
javax.naming.NameNotFoundException: CMS not bound
Well, i have no idea how to find out under what name it is registered, if it is at all...
the cms service, as an mbean, is named : name="portal:service=CMS"
the descriptor of this service is in :
with jbp 2.4, I can't see the jndi declaration.
so I guess there was not for 2.2 either.
may be you can add it to your CMS Service of 2.2 ?
may be with the example of the code and descriptor of 2.6 ?
(which is a good idea to have it...)
or look at how to get a jmx service from your web app, without jndi.
There's some wiki about this...