geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Puri <>
Subject Utilizing Geronimo monitoring through command line
Date Fri, 28 May 2010 14:00:59 GMT

I am looking in a scenario of a business infrastructure where admin console
is disallowed and user still want to use and watch capabilities of Geronimo
monitoring portlet functionality without logging in admin console.

First step for me to achieve this is to start and stop Stat Query through a
command line. So I am trying to start Snapshot (Stat. Query) in monitoring
portlet of Geronimo 2.1.5 with a java program.

Through Admin console I can start it without any fail by clicking on "Enable
Query". when I start it with a java program I am able to start snapshot
(Stat. Query) but I am also getting following error in command prompt:

ERROR [MasterRemoteControlJMX]
org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with
org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with

In my java program, I am following these steps:

1.Creating MBeanServerConnection object
MBeanServerConnection mbServerConn;
JMXServiceURL serviceURL = new
Hashtable<String, Object> env = new Hashtable<String, Object>();
String[] credentials = new String[2];
credentials[0] = "system";
credentials[1] = "manager";
env.put(JMXConnector.CREDENTIALS, credentials);

JMXConnector connector = JMXConnectorFactory.connect(serviceURL, env);
mbServerConn = connector.getMBeanServerConnection();

2. Retrieving the mbean name to the agent-car-jmx plugin

if(PATH == null) {
Set<ObjectName> mbeanNames = mbServerConn.queryNames(new
ObjectName("*:name=MasterRemoteControlJMX,*"), null);
for(Iterator<ObjectName> it = mbeanNames.iterator(); it.hasNext(); ) {
String mbeanName = ((ObjectName);
if(mbeanName.contains("agent-car-jmx") &&
mbeanName.contains("MasterRemoteControlJMX") && mbeanName.contains("GBean"))
PATH = mbeanName;
if(PATH == null) {
throw new Exception("[ERROR] Required mbean not found: agent-car-jmx");

Here I am getting mbean name as

3. Invoking startSnapshot

long time = 60000;
int days = 2;
mbServerConn.invoke(new ObjectName(PATH),"startSnapshot", new Object[] {
time, days }, new String[] { "java.lang.Long", "java.lang.Integer" });
After invoking, I can see snapshot running but also getting

I am getting *SUCCESS* when I use this java client with *G 2.1.4 without any
exception*. When I checked code change in 2.1.5, I can see change in
* *
One JIRA is there for this change *"GERONIMO-4823 role-based administration
capabilities" *Change in is like this-

*code-snippet of
 mbServerConn =

I have also checked the ** where
ClassCastException is coming, I can see error in "archiveDS"

*code-snippet of
activeDS =
archiveDS =

when I invoked start snapshot through my java client, For activeDS, object
created is of TranqlDataSource and for archiveDS, it is of

Please help me in understanding this behavior and give me some pointers to
go forward in this effort. I really appreciate your help.


View raw message