AOP in CS2.0: Element ADVICE is undefined in INSTANCE.

58 views
Skip to first unread message

marc

unread,
Jul 9, 2012, 8:21:53 AM7/9/12
to ColdSpring-Users
Hi,

I try to use AOP in Coldspring 2.0:

<bean id="remotePageService"
class="coldspring.aop.framework.RemoteFactoryBean" lazy-init="false">
<property name="target">
<ref bean="pageService" />
</property>
<property name="serviceName">
<value>remotePageService</value>
</property>
<property name="relativePath">
<value>/ws</value>
</property>
<property name="remoteMethodNames">
<value>list</value>
</property>
<property name="beanFactoryName">
<value>beanfactory</value>
</property>
<property name="interceptorNames">
<list>
<value>listAdvisor</value>
</list>
</property>
</bean>

<!-- AOP -->
<bean id="listAroundAdvice"
class="Application.Model.AOP.listAroundAdvice" />
<bean id="listAdvisor"
class="coldspring.aop.support.NamedMethodPointcutAdvisor">
<property name="advice">
<ref bean="listAroundAdvice" />
</property>
<property name="mappedNames"><value>list</value></property>
</bean>

When I request a page (not using the Remote service) I get an error:

Error creating bean 'remotePageService'

struct

Detail: [empty string]
ErrNumber: 0
Message: Element ADVICE is undefined in INSTANCE.
Resolvedname: INSTANCE
StackTrace: coldfusion.runtime.UndefinedElementException: Element
ADVICE is undefined in INSTANCE.

I do use the element advice in my Coldspring.xml. What is this error
referring to, if not this?

Marc

Mark Mandel

unread,
Jul 9, 2012, 9:09:13 AM7/9/12
to coldspri...@googlegroups.com
What is the full error trace please.

Mark


Marc

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




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

2 Devs from Down Under Podcast

marc

unread,
Jul 9, 2012, 4:09:02 PM7/9/12
to ColdSpring-Users
Here it is,

The ADVICE argument passed to the setAdvice function is not of type
coldspring.aop.Advice.
If the component name is specified as a type of this argument, it is
possible that either a definition file for the component cannot be
found or is not accessible.

The error occurred in H:\www\CMS\Frameworks\coldspring1-2-final\aop
\support\AbstractPointcutAdvisor.cfc: line 51
Called from H:\www\CMS\Frameworks\coldspring1-2-final\beans
\DefaultXmlBeanFactory.cfc: line 963
Called from H:\www\CMS\Frameworks\coldspring1-2-final\beans
\DefaultXmlBeanFactory.cfc: line 632
Called from H:\www\CMS\Frameworks\coldspring1-2-final\beans
\DefaultXmlBeanFactory.cfc: line 685
Called from H:\www\CMS\Frameworks\coldspring1-2-final\beans
\DefaultXmlBeanFactory.cfc: line 216
Called from H:\www\CMS\Frameworks\coldspring1-2-final\beans
\DefaultXmlBeanFactory.cfc: line 46
Called from H:\www\CMS\Frameworks\ModelGlue_3.2.439\gesture\loading
\ColdSpringBootstrapper.cfc: line 104
Called from H:\www\CMS\Frameworks\ModelGlue_3.2.439\gesture\loading
\ColdSpringBootstrapper.cfc: line 127
Called from H:\www\CMS\Frameworks\ModelGlue_3.2.439\gesture\loading
\ColdSpringBootstrapper.cfc: line 138
Called from H:\www\CMS\Frameworks\ModelGlue_3.2.439\gesture
\ModelGlue.cfm: line 82
Called from H:\www\CMS\wwwroot\index.cfm: line 41

49 : </cffunction>
50 :
51 : <cffunction name="setAdvice" access="public" returntype="void"
output="false">
52 : <cfargument name="advice" type="coldspring.aop.Advice"
required="true" />
53 : <cfset variables.advice = arguments.advice />
> E: mark.man...@gmail.com

marc

unread,
Jul 9, 2012, 4:31:03 PM7/9/12
to ColdSpring-Users
As you can see after posting the error I switched from 2.0 back to 1.2
to see if that did work. But 1.2 gave me the error as well. My advice
is like this:

<cfcomponent output="false" name="listAroundAdvice"
interface="coldspring.aop.MethodInterceptor">

so it does extend coldspring.aop.MethodInterceptor which in turn
extends coldspring.aop.Advice...

Marc

Mark Mandel

unread,
Jul 9, 2012, 4:33:14 PM7/9/12
to coldspri...@googlegroups.com
Yeah - I need the full error from 2.0, not from 1.2

The error from 1.2 means nothing, as the code bases have compatibility issues.

Mark


Marc

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

marc

unread,
Jul 9, 2012, 4:43:09 PM7/9/12
to ColdSpring-Users
Oops...

interface="coldspring.aop.MethodInterceptor" is not the same as
extends="coldspring.aop.MethodInterceptor" :\

AOP in CS 1.2 works, now checking about my initial q which concerned
CS 2.0

Marc

marc

unread,
Jul 9, 2012, 4:53:13 PM7/9/12
to ColdSpring-Users
I switched to CS 2.0 and get an error but it's not the one I started
this thread with. I'll make a new one.
Sorry for the mess.

Marc
Reply all
Reply to author
Forward
0 new messages