[jira] Commented: (GERONIMO-5355) ClassCastException while starting snapshot (Stat Query) in G 215 Monitoring portlet through java client
[ https://issues.apache.org/jira/browse/GERONIMO-5355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12977640#action_12977640 ] Vamsavardhana Reddy commented on GERONIMO-5355: --- Completed: At revision: 1055305 in branches\2.1 (i.e. 2.1.8-SNAPSHOT). o Exception is due to a different thread context classloader at play when the method is invoked through RMI as opposed to invocation through admin console. Fixed by changing the context classloader for the lookups. ClassCastException while starting snapshot (Stat Query) in G 215 Monitoring portlet through java client --- Key: GERONIMO-5355 URL: https://issues.apache.org/jira/browse/GERONIMO-5355 Project: Geronimo Issue Type: Bug Security Level: public(Regular issues) Components: monitoring Affects Versions: 2.1.5 Reporter: Amit Puri Assignee: Vamsavardhana Reddy Fix For: 2.1.8 In a java client where MBeanServerConnection is created and invoke startSnapshot method in Monitoring Portlet of G 215, Stat Query snapshot started but we can also find ClassCastException. ... ERROR [MasterRemoteControlJMX] org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with javax.sql.DataSource java.lang.ClassCastException: org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with javax.sql.DataSource at org.apache.geronimo.monitoring.MasterRemoteControlJMX.init(MasterRemoteControlJMX.java:110) at org.apache.geronimo.monitoring.snapshot.SnapshotProcessor.getMRC(SnapshotProcessor.java:148) at org.apache.geronimo.monitoring.snapshot.SnapshotProcessor.takeSnapshot(SnapshotProcessor.java:59) at org.apache.geronimo.monitoring.snapshot.SnapshotThread.run(SnapshotThread.java:103) ... In G 214, this exception does not come while using same java client. These steps are followed in java client: 1.Creating MBeanServerConnection object ... MBeanServerConnection mbServerConn; JMXServiceURL serviceURL = new JMXServiceURL(service:jmx:rmi:///jndi/rmi://localhost/JMXConnector); HashtableString, Object env = new HashtableString, 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) { SetObjectName mbeanNames = mbServerConn.queryNames(new ObjectName(*:name=MasterRemoteControlJMX,*), null); for(IteratorObjectName it = mbeanNames.iterator(); it.hasNext(); ) { String mbeanName = ((ObjectName)it.next()).getCanonicalName(); if(mbeanName.contains(agent-car-jmx) mbeanName.contains(MasterRemoteControlJMX) mbeanName.contains(GBean)) { PATH = mbeanName; break; }} if(PATH == null) { throw new Exception([ERROR] Required mbean not found: agent-car-jmx); }} .. Here I am getting mbean name as geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.plugins.monitoring/agent-car-jmx/2.1.5/car,j2eeType=GBean,name=MasterRemoteControlJMX 3. Invoking startSnapshot .. long time = 30; int days = 2; mbServerConn.invoke(new ObjectName(PATH),startSnapshot, new Object[] { time, days }, new String[] { java.lang.Long, java.lang.Integer }); .. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (GERONIMO-5355) ClassCastException while starting snapshot (Stat Query) in G 215 Monitoring portlet through java client
[ https://issues.apache.org/jira/browse/GERONIMO-5355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12966444#action_12966444 ] Vamsavardhana Reddy commented on GERONIMO-5355: --- The exception seems to be due to a org.tranql.connector.jdbc.TranqlDataSource$SelfReference object getting bound to the JNDI instead of org.tranql.connector.jdbc.TranqlDataSource. The TranqlDataSource object is to be obtained by calling getContent() method on the SelfReference object. ClassCastException while starting snapshot (Stat Query) in G 215 Monitoring portlet through java client --- Key: GERONIMO-5355 URL: https://issues.apache.org/jira/browse/GERONIMO-5355 Project: Geronimo Issue Type: Bug Security Level: public(Regular issues) Components: monitoring Affects Versions: 2.1.5 Reporter: Amit Puri In a java client where MBeanServerConnection is created and invoke startSnapshot method in Monitoring Portlet of G 215, Stat Query snapshot started but we can also find ClassCastException. ... ERROR [MasterRemoteControlJMX] org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with javax.sql.DataSource java.lang.ClassCastException: org.tranql.connector.jdbc.TranqlDataSource$SelfReference incompatible with javax.sql.DataSource at org.apache.geronimo.monitoring.MasterRemoteControlJMX.init(MasterRemoteControlJMX.java:110) at org.apache.geronimo.monitoring.snapshot.SnapshotProcessor.getMRC(SnapshotProcessor.java:148) at org.apache.geronimo.monitoring.snapshot.SnapshotProcessor.takeSnapshot(SnapshotProcessor.java:59) at org.apache.geronimo.monitoring.snapshot.SnapshotThread.run(SnapshotThread.java:103) ... In G 214, this exception does not come while using same java client. These steps are followed in java client: 1.Creating MBeanServerConnection object ... MBeanServerConnection mbServerConn; JMXServiceURL serviceURL = new JMXServiceURL(service:jmx:rmi:///jndi/rmi://localhost/JMXConnector); HashtableString, Object env = new HashtableString, 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) { SetObjectName mbeanNames = mbServerConn.queryNames(new ObjectName(*:name=MasterRemoteControlJMX,*), null); for(IteratorObjectName it = mbeanNames.iterator(); it.hasNext(); ) { String mbeanName = ((ObjectName)it.next()).getCanonicalName(); if(mbeanName.contains(agent-car-jmx) mbeanName.contains(MasterRemoteControlJMX) mbeanName.contains(GBean)) { PATH = mbeanName; break; }} if(PATH == null) { throw new Exception([ERROR] Required mbean not found: agent-car-jmx); }} .. Here I am getting mbean name as geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.plugins.monitoring/agent-car-jmx/2.1.5/car,j2eeType=GBean,name=MasterRemoteControlJMX 3. Invoking startSnapshot .. long time = 30; int days = 2; mbServerConn.invoke(new ObjectName(PATH),startSnapshot, new Object[] { time, days }, new String[] { java.lang.Long, java.lang.Integer }); .. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.