Announcement Announcement Module
Collapse
No announcement yet.
jmx client connector question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jmx client connector question

    Hi,

    I'm encountering a problem : I have some MBeans deployed in a remote server (not spring enabled).

    These MBeans interfaces expose some methods for which my client do not have the used parameter types in its classpath.

    Thing is, I don't want/need to use those methods, but the org.springframework.jmx.access.MBeanClientIntercep tor#invoke method tries to fetch the whole MBeanInfo for the remote MBean and throws a ClassNotFoundException as I'm missing those classes, thus preventing me to use the plain String only methods.

    Is there any way to achieve this or do I have to manually code the JMX calls/hack the client interceptor ?

    Here is the stack trace
    note : the com.hsbc.hbfr.loadbalancing.websphere.WAS5MBeanCli entInterceptor is a class basically copy/pasted from org.springframework.jmx.access.MBeanClientIntercep tor but adapted for websphere 5/5.1 implementation of JMX (not standard compliant)

    org.springframework.jmx.access.MBeanInfoRetrievalE xception: Unable to locate class specified in method signature; nested exception is java.lang.ClassNotFoundException: com.hsbc.hbfr.ccf.at.admin.IMonitorableResource
    Caused by:
    java.lang.ClassNotFoundException: com.hsbc.hbfr.ccf.at.admin.IMonitorableResource
    at com.ibm.ws.classloader.CompoundClassLoader.findCla ss(CompoundClassLoader.java(Compiled Code))
    at com.ibm.ws.classloader.CompoundClassLoader.loadCla ss(CompoundClassLoader.java(Compiled Code))
    at java.lang.ClassLoader.loadClass(ClassLoader.java(C ompiled Code))
    at org.springframework.util.ClassUtils.forName(ClassU tils.java:177)
    at org.springframework.util.ClassUtils.forName(ClassU tils.java:147)
    at org.springframework.jmx.support.JmxUtils.parameter InfoToTypes(JmxUtils.java:130)
    at com.hsbc.hbfr.loadbalancing.websphere.WAS5MBeanCli entInterceptor.retrieveMBeanInfo(WAS5MBeanClientIn terceptor.java:214)
    at com.hsbc.hbfr.loadbalancing.websphere.WAS5MBeanCli entInterceptor.afterPropertiesSet(WAS5MBeanClientI nterceptor.java:143)
    at com.hsbc.hbfr.loadbalancing.websphere.WAS5MBeanPro xyFactoryBean.afterPropertiesSet(WAS5MBeanProxyFac toryBean.java:69)
    at com.hsbc.hbfr.ccf.at.lb.admin.controllers.LBModify Controller.createProxy(LBModifyController.java:191 )
    at com.hsbc.hbfr.ccf.at.lb.admin.controllers.AppMonit orDiagnosticFetcher.fetchStatusUsingOldApplication MonitorInterface(AppMonitorDiagnosticFetcher.java: 91)
    at com.hsbc.hbfr.ccf.at.lb.admin.controllers.AppMonit orDiagnosticFetcher.run(AppMonitorDiagnosticFetche r.java:74)
    at com.hsbc.hbfr.ccf.at.lb.admin.controllers.LBStatus Controller$WorkerThread.run(LBStatusController.jav a:297)
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R org.springframework.jmx.access.MBeanInfoRetrievalE xception: Unable to locate class specified in method signature; nested exception is java.lang.ClassNotFoundException: com.hsbc.hbfr.ccf.at.admin.IMonitorableResource
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R Caused by: java.lang.ClassNotFoundException: com.hsbc.hbfr.ccf.at.admin.IMonitorableResource
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.findCla ss(CompoundClassLoader.java(Compiled Code))
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.loadCla ss(CompoundClassLoader.java(Compiled Code))
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at java.lang.ClassLoader.loadClass(ClassLoader.java(C ompiled Code))
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at org.springframework.util.ClassUtils.forName(ClassU tils.java:177)
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at org.springframework.util.ClassUtils.forName(ClassU tils.java:147)
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at org.springframework.jmx.support.JmxUtils.parameter InfoToTypes(JmxUtils.java:130)
    [12/12/06 11:31:26:200 CET] 68fc591 SystemErr R at com.hsbc.hbfr.loadbalancing.websphere.WAS5MBeanCli entInterceptor.retrieveMBeanInfo(WAS5MBeanClientIn terceptor.java:214)

  • #2
    I think you have to hack the MBeanClientInterceptor. Maybe you sould raise a JIRA issue (I think it would be a useful feature to be able to specify the interface of the MBean you want to proxy)?

    Comment


    • #3
      If anyone is interested, what I did (at least temporarily), and which does want I want is replace the following from org.springframework.jmx.access.MBeanClientIntercep tor#retrieveMBeanInfo

      Code:
      for (int x = 0; x < operationInfo.length; x++) {
      	MBeanOperationInfo opInfo = operationInfo[x];
      	this.allowedOperations.put(
      			new MethodCacheKey(
      	opInfo.getName(),
      	JmxUtils.parameterInfoToTypes(opInfo.getSignature())), opInfo);
      }
      by
      Code:
      for (int x = 0; x < operationInfo.length; x++) {
      	MBeanOperationInfo opInfo = operationInfo[x];
      	try {
      		this.allowedOperations.put(
      			new MethodCacheKey(
      				opInfo.getName(),
      				JmxUtils.parameterInfoToTypes(opInfo.getSignature())), 
      			opInfo);
      // allows for connecting to a remote instance even if all exposed operations can't be called 
      	} catch (ClassNotFoundException e) {
      		logger.warn("Unable to locate class specified in method signature, method won't be available");
      	}
      }
      I did not test what would happen if calling a method that was rejected due to the classNotFound, but i guess it would throw an InvocationFailureException ?

      Comment

      Working...
      X