AOP Schema and factory -beans

24 views
Skip to first unread message

Chris Blackwell

unread,
Feb 15, 2013, 5:40:15 PM2/15/13
to coldspring-users
Hi Mark,

I've hit an odd problem, trying to use aop, and after purchasing FusionDebug I think i've tracked it down.
The error i've been getting is "invalid component definition, can't find java.lang.String", stack trace below

Here's the problem, I have a couple of beans that looks like this (with irrelevant properties removed)

<!-- just including this empty aop:config node 
is enough to trigger the error -->
<aop:config />

<bean id="CfStatic" class="org.cfstatic.CfStatic">
  <constructor-arg name="checkForUpdates">
    <bean factory-bean="Config" factory-method="getReloadEveryRequest" />
  </constructor-arg>
</bean>

<bean id="Config" class="config.hostconfig.cfc.Config">
  <constructor-arg name="reloadEveryRequest" value="true" />
</bean>

What seems to be the issue is that somehow the string "true" returned from the anonymous bean in red is getting through to AbstractAdvisorAutoProxyCreator.cfc and it's trying to  inspect it using the ReflectionService.

As to where to fix it, well...
I have included a hack below, I don't think its a viable fix, but I needed something to get it going.

Cheers, Chris


Stacktrace
Class.cfc:43 /coldspring/core/reflect/Class.cfc
ReflectionService.cfc:46 /coldspring/core/reflect/ReflectionService.cfc
AbstractAdvisorAutoProxyCreator.cfc:79 /coldspring/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.cfc
Observable.cfc:84 /coldspring/util/Observable.cfc
BeanPostProcessorObservable.cfc:86 /coldspring/beans/factory/config/BeanPostProcessorObservable.cfc
AbstractBeanDefinition.cfc:85 /coldspring/beans/support/AbstractBeanDefinition.cfc
AbstractBeanFactory.cfc:50 /coldspring/beans/AbstractBeanFactory.cfc
RefValue.cfc:40 /coldspring/beans/support/RefValue.cfc
AbstractProperty.cfc:46 /coldspring/beans/support/AbstractProperty.cfc
CFCBeanDefinition.cfc:35 /coldspring/beans/support/CFCBeanDefinition.cfc
AbstractBeanDefinition.cfc:55 /coldspring/beans/support/AbstractBeanDefinition.cfc
AbstractBeanFactory.cfc:50 /coldspring/beans/AbstractBeanFactory.cfc
AbstractBeanFactory.cfc:202 /coldspring/beans/AbstractBeanFactory.cfc
AbstractBeanFactory.cfc:178 /coldspring/beans/AbstractBeanFactory.cfc
XmlBeanFactory.cfc:54 /coldspring/beans/xml/XmlBeanFactory.cfc
XmlBeanFactory.cfc:33 /coldspring/beans/xml/XmlBeanFactory.cfc
Application.cfc:62 /Application.cfc


diff --git a/coldspring/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.cfc b/coldspring/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.cindex 6a745ef..0d8096f 100644
--- a/coldspring/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.cfc
+++ b/coldspring/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.cfc
@@ -74,7 +74,7 @@
                var local = {};
                var earlyProxyCache = getEarlyProxyCache();

-               if(!structKeyExists(earlyProxyCache, arguments.beanName))
+               if(!structKeyExists(earlyProxyCache, arguments.beanName) and !isInstanceOf(arguments.bean, "java.lang.Object"))
                {
                        local.class = getReflectionService().loadClass(getMetadata(arguments.bean).name);

Mark Mandel

unread,
Feb 17, 2013, 4:39:37 PM2/17/13
to coldspri...@googlegroups.com
Doh - yeah, looks like the AbstractAdvisorAutoProxyCreatoisn't filtering non-CFC objects.

I'll have a dig in.

Mark


--
You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldspring-use...@googlegroups.com.
To post to this group, send email to coldspri...@googlegroups.com.
Visit this group at http://groups.google.com/group/coldspring-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

2 Devs from Down Under Podcast
Reply all
Reply to author
Forward
0 new messages