Interface coldspring.aop.MethodInterceptor cannot extend the component coldspring.aop.Advice.

69 views
Skip to first unread message

marc

unread,
Jul 9, 2012, 5:03:17 PM7/9/12
to ColdSpring-Users
Hi,

I use CS 2.0 and a modified MG version based on 3.2.439 by Chris
Blackwell.

When I try out AOP I get an error (see subject). I switched the
frameworks - from CS 2.0 back to CS1.2 and also to a stock MG and it
worked fine (at least I didn't get an error as soon as I made a
request to my app). Back to CS 2.0 and the modified MG. I even
restarted the CF 9.0.1 server but that made no difference, still got
the error

This is my Coldspring.xml

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


This is the advice Application.Model.AOP.listAroundAdvice:

<cfcomponent output="false" name="listAroundAdvice"
extends="coldspring.aop.MethodInterceptor">
[...]
<cfcomponent >


This is the error plus stack trace:

Interface coldspring.aop.MethodInterceptor cannot extend the component
coldspring.aop.Advice.
ColdFusion interface cannot extend ColdFusion component.

The error occurred in H:\www\CMS\Frameworks\Coldspring\core\reflect
\Class.cfc: line 43
Called from H:\www\CMS\Frameworks\Coldspring\core\reflect
\ReflectionService.cfc: line 46
Called from H:\www\CMS\Frameworks\Coldspring\beans\support
\CFCBeanDefinition.cfc: line 71
Called from H:\www\CMS\Frameworks\Coldspring\beans
\BeanDefinitionRegistry.cfc: line 78
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml\XmlParser.cfc:
line 198
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml\XmlParser.cfc:
line 93
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml\XmlParser.cfc:
line 61
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml
\XmlBeanFactory.cfc: line 52
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml
\XmlBeanFactory.cfc: line 33
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 184
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 51
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 195
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 206
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\ModelGlue.cfm:
line 81
Called from H:\www\CMS\wwwroot\index.cfm: line 41

41 : var builder = 0;
42 : var reflectionService =
getComponentMetaData("coldspring.core.reflect.ReflectionService").singleton.instance;
43 : var meta = getComponentMetadata(arguments.className);
44 :
45 : //builder.setLength(builder.lastIndexOf(".")); << CF8 fails on
this because it can't resolve Java Methods. Grrr.

Hope somebody can shed some light on this...

Marc

Mark Mandel

unread,
Jul 9, 2012, 5:07:22 PM7/9/12
to coldspri...@googlegroups.com
It looks a lot like your server doesn't know which ColdSpring it is using. How are your mappings / directory structure look like?

What does your listAroundAdvice look like?

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, 6:14:38 PM7/9/12
to ColdSpring-Users
>>How are your mappings / directory structure look like?

<cfset baseDirectory=ReReplaceNoCase(ExpandPath("/"),"[^\\^/.]+[\\/]
{1}$","","All")>
<cfset THIS.mappings["/Coldspring"]="#baseDirectory#Frameworks
\Coldspring">
<cfset THIS.mappings["/Config"]="#baseDirectory#Frameworks
\config_CMS">
<cfset THIS.mappings["/ModelGlue"]="#baseDirectory#Frameworks
\ModelGlue">
CMS/
Frameworks
Coldspring
coldspring1-2-final
config_CMS
ModelGlue
ModelGlue_3.2.439
Transfer
MVC
CMS
Application
Controllers
[...]
Resources
wwwroot
>>What does your listAroundAdvice look like?

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

<cffunction name="init" access="public">
<cfreturn this />
</cffunction>

<cffunction name="invokeMethod" access="public" returntype="any">
<cfargument name="mi" type="coldspring.aop.MethodInvocation"
required="true" />

<cfset local.result=arguments.mi.proceed()>
<cfset local.result=local.result.getCollection()>
<cfreturn local.result>
</cffunction>

</cfcomponent>

/Coldspring contains the /orm/hibernate folder so it _is_ v2.0, from
your develop branch,
https://github.com/markmandel/coldspring.

I have the stock MG version ModelGlue(/ModelGlue) and the modified
version by Chris Blackwell (ModelGlue_3.2.439)
Coldspring contains version 2, coldspring1-2-final is the stable
release. All in one folder.
Maybe the folder names conflict with likewise named mappings and have
precedence? Worth a try tomorrow...

Marc

Mark Mandel

unread,
Jul 9, 2012, 6:16:45 PM7/9/12
to coldspri...@googlegroups.com
Yeah, that is what I'm thinking.

The error sounds like you're trying to implement the cs1.2 version of MethodInterceptor.

Mark


On Tue, Jul 10, 2012 at 8:14 AM, marc <marc.at...@gmail.com> wrote:
Maybe the folder names conflict with likewise named mappings and have
precedence? Worth a try tomorrow...



marc

unread,
Jul 10, 2012, 5:44:57 PM7/10/12
to ColdSpring-Users
Ok, so I removed CS 1.2 and stock MG 3.2.439 so I only have your CS2.0
develop version and a modified MG by Chrisa Blackwell that knows how
to talk to CS2.0. AppMappings point to these files.I restart the
server, request a page from my app - I'm not doing any AOP here so I
expect the login screen after the initialisation is done - but I get
another error message:

invalid component or interface name.
The coldspring.aop.Advice ColdFusion component or interface name, used
to extend or implement the coldspring.aop.MethodInterceptor component
is invalid. Ensure that the file exists, that the name does not start
or end with a period (.), and the name is not an empty string.

The error occurred in H:\www\CMS\Frameworks\coldspring\core\reflect
\Class.cfc: line 49
47 : Writedump(arguments);abort;
48 : }
49 : var meta = getComponentMetadata(arguments.className);
50 :
51 : //builder.setLength(builder.lastIndexOf(".")); << CF8 fails on
this because it can't resolve Java Methods. Grrr.

I do a dump of this invalid component or interface:

try{
Writedump(arguments.className);
}
catch(Any e){
Writedump(arguments);abort;
}

var meta = getComponentMetadata(arguments.className);

when the error is thrown the Writedump(arguments) shows this :

CLASSNAME Application.Model.AOP.listAroundAdvice

This is the advice I want to wrap around the target objects.

It looks like this:

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

<cffunction name="init" access="public">
<cfreturn this />
</cffunction>

<cffunction name="invokeMethod" access="public" returntype="any">
<cfargument name="mi" type="coldspring.aop.MethodInvocation"
required="true" />

<cfset local.result=arguments.mi.proceed()>
<cfset local.result=local.result.getCollection()>
<cfreturn local.result>
</cffunction>

</cfcomponent>

I figured maybe the mapping

<cfset baseDirectory=ReReplaceNoCase(ExpandPath("/"),"[^\\^/.]+[\\/]
{1}$","","All")>
<cfset THIS.mappings["/Application"]="#baseDirectory#MVC\CMS
\Application">

is wrong but when I do this

<cfdump
var="#GetMetaData("Application.Model.AOP.listAroundAdvice")#"><cfabort>

in Application.cfc I get a dump of object of java.lang.Class

This is my Coldspring.xml part where I define the AOP:
What's wrong with this components name?

Marc

Mark Mandel

unread,
Jul 10, 2012, 6:06:04 PM7/10/12
to coldspri...@googlegroups.com
You're ListAroundAdvice needs to implement the interface, not extend it.

See:

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 11, 2012, 5:22:00 PM7/11/12
to ColdSpring-Users
You're right, that's listed in the migrating wiki. So I changed the
listAroundAdvice so it's implementing coldspring.aop.MethodInterceptor
rather than extending it.

However, I got another error:

Interface Coldspring.aop.MethodInterceptor cannot extend the component
coldspring.aop.Advice.
ColdFusion interface cannot extend ColdFusion component.

The error occurred in H:\www\CMS\Frameworks\Coldspring\core\reflect
\Class.cfc: line 43
41 : var builder = 0;
42 : var reflectionService =
getComponentMetaData("coldspring.core.reflect.ReflectionService").singleton.instance;
43 : var meta = getComponentMetadata(arguments.className);
44 :
45 : //builder.setLength(builder.lastIndexOf(".")); << CF8 fails on
this because it can't resolve Java Methods. Grrr.


Figured it might be because of the version, I changed back from the
develop version to the CS2.0 Alpha1 tag from your Github, restarted
the CF server and requested the page. Got this error:

Invalid component or interface name.
The coldspring.aop.Advice ColdFusion component or interface name, used
to extend or implement the Coldspring.aop.MethodInterceptor component
is invalid. Ensure that the file exists, that the name does not start
or end with a period (.), and the name is not an empty string.

The error occurred in H:\www\CMS\Frameworks\coldspring\core\reflect
\Class.cfc: line 59
Called from H:\www\CMS\Frameworks\coldspring\core\reflect
\ReflectionService.cfc: line 46
Called from H:\www\CMS\Frameworks\coldspring\beans\support
\CFCBeanDefinition.cfc: line 71
Called from H:\www\CMS\Frameworks\coldspring\beans
\BeanDefinitionRegistry.cfc: line 78
Called from H:\www\CMS\Frameworks\coldspring\beans\xml\XmlParser.cfc:
line 169
Called from H:\www\CMS\Frameworks\coldspring\beans\xml\XmlParser.cfc:
line 79
Called from H:\www\CMS\Frameworks\coldspring\beans\xml\XmlParser.cfc:
line 61
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml
\XmlBeanFactory.cfc: line 52
Called from H:\www\CMS\Frameworks\Coldspring\beans\xml
\XmlBeanFactory.cfc: line 33
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 184
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 51
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 195
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\loading
\ColdSpringBootstrapper.cfc: line 206
Called from H:\www\CMS\Frameworks\ModelGlue\gesture\ModelGlue.cfm:
line 81
Called from H:\www\CMS\wwwroot\index.cfm: line 41

57 : setAssignableCache(StructNew());
58 :
59 : setMeta(getComponentMetadata(arguments.className));
60 :
61 : //determine if we are an interface or not

Both errors hit me before. I've got the feeling I'm running in circles
here..

Marc

Mark Mandel

unread,
Jul 11, 2012, 5:46:47 PM7/11/12
to coldspri...@googlegroups.com

This sounds a lot like you have both versions of coldspring accessible on /coldspring and CF doesn't know which one to pick.

Mark

Sent from my mobile doohickey.

Reply all
Reply to author
Forward
0 new messages