3 Replies Latest reply on Feb 12, 2008 5:20 AM by adrian.brock

    Avoiding creating AOPContainter for MC beans

    brian.stansberry

      I've got some -beans.xml files where I build up a pretty basic pojo configuration object and then inject it into another bean. I'm seeing that the injected object is an instance of AOPContainerProxy rather than the underlying pojo.

      Anyone know why an AOP proxy is being injected, and if there is a way to turn it off? JBC uses some internal reflection code to change fields on the injected object; this breaks when the object is a proxy.

      Here's an example from deploy/cluster/jbossweb-clusteredsso-beans.xml:

      <bean name="ClusteredSSOCacheConfig" class="org.jboss.cache.config.Configuration">
      
       .... set various properties, some with nested beans
      
       </bean>
      
       <!-- Now we use the above configuration to construct the cache itself -->
       <bean name="ClusteredSSOCache" class="org.jboss.cache.jmx.CacheJmxWrapper">
       <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ClusteredSSOCache", exposedInterface=org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
      
       <property name="configuration">
       <inject bean="ClusteredSSOCacheConfig"/>
       </property>
      
       </bean>