Env: JDK1.6, Spring 2.5.1
I have an MBean server and am enabling remoting using RMI.
I am defining an MBeanServerConnectionFactoryBean with the
service URL to enable clients to connect:
I inject this factory bean into a typical client as follows:Code:<bean id="jmxClientInterface" class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean" p:serviceUrl="${my.serviceurl}" p:connectOnStartup="false" />
The problem: however this injection yields an exception as follows.Code:package com.xxx.client; public class JmxClient { //... private MBeanServerConnectionFactoryBean connection_factory; public MBeanServerConnectionFactoryBean getServerConnectionFactory() { return connection_factory; } public synchronized final void setServerConnectionFactory(final MBeanServerConnectionFactoryBean x) { this.connection_factory = x; } //... } <bean id="jmxClient" class="com.xxx.client.JmxClient" scope="prototype" p:serverConnectionFactory-ref="jmxClientInterface" p:defaultDomain="${my.domain}" />
I am injecting an MBeanServerConnectionFactoryBean into a field
which is of the same type (MBeanServerConnectionFactoryBean).
Yet, it says that the injected entity is of type $Proxy.
What am I missing? How did the injected MBeanServerConnectionFactoryBeanCode:PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy19] to required type [org.springframework.jmx.support.MBeanServerConnectionFactoryBean] for property 'serverConnectionFactory'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy19] to required type [org.springframework.jmx.support.MBeanServerConnectionFactoryBean] for property 'serverConnectionFactory': no matching editors or conversion strategy found
suddenly become a proxy?
Thanks,
/U


Reply With Quote