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);