Paul,

I'm concerned about two things here, first off is CF 6.1, do you have access to a 7 instance? However, I don't think that's it. ColdSpring uses it's own frameworks type in multiple places, not only in the AOP framework, although it's pretty heavy in there. The fact that you are putting ColdSpring in an 'eits' directory and then using it as part of the class package name, I really think that will be a problem. Why don't you create a mapping to /{serverRoot}/eits/coldspring for coldspring and then make sure you use/extend  components like coldspring.aop.framework.ProxyFactoryBean and coldspring.aop.MethodInterceptor with the proper package name.

I really hope that helps, I'm not sure where to start if it doesn't as I don't have a 6.1 instance on hand

Thanks, Chris

On Jun 13, 2006, at 3:22 PM, Paul Roe wrote:

Ok so I am still fighting this issue and just to make sure that it's a caching issue I thought I'd put it out there and see if any of you guys can spot any obvious problems.

I am trying to use aop to add around advice to one of my services.  Here is my cs xml
  
    <bean id="SiteDAO" class="eits.components.Site.SiteDAO" singleton="true">
        <property name="DataSourceConfig"><ref bean="DataSourceConfig" /></property>
        <property name="InstancePath"><value>eits.components.Site.Site</value></property>
        <property name="SequenceName"><value>eits.eits_site_id_seq</value></property>
    </bean>
   
    <bean id="SiteDGO" class="eits.components.Site.SiteDGO" singleton="true">
        <property name="DataSourceConfig"><ref bean="DataSourceConfig" /></property>
    </bean>
   
   <!-- set up a proxy for the service -->
    <bean id="SiteServiceTarget" class="eits.components.Site.SiteService" singleton="true">
        <property name="DAO"><ref bean="SiteDAO" /></property>
        <property name="DGO"><ref bean="SiteDGO" /></property>
        <property name="MessagePath"><value>${MessageInstancePath}</value></property>
        <property name="Utilities"><ref bean="Utilities" /></property>
    </bean>
    <bean id="SiteService" class="eits.coldspring.aop.framework.ProxyFactoryBean ">
        <property name="target"><ref bean="SiteServiceTarget" /></property>
        <property name="interceptorNames"><list><value>HistoryAroundAdvice</value></list></property>
    </bean>


What I am getting is the following error:

Could not find the ColdFusion Component [runtime _expression_]

Please check that the given name is correct and that the component exists.



This happens because the service function I am calling uses getInstancePath().  InstancePath is a property that I am defining
in the
SiteDAO bean cs. When I try to dump the value of instancepath it says it's a [runtime _expression_] which I've never
seen before. If I remove the aop stuff everything runs fine. any help with this would be great. also if it helps I have included the cfc
for my aroundadvice below as well as the cs xml for that

<cfcomponent name="History Around Advice" extends="eits.coldspring.aop.MethodInterceptor">

    <cffunction name="invokeMethod" access="public" returntype="any">
        <cfargument name="mi" type="eits.coldspring.aop.MethodInvocation" required="true" />
        <cfset var args = arguments.mi.getArguments() />
        <cfset var methodName = arguments.mi.getMethod().getMethodName() />
        <cfdump var="#methodName#">
        <cfswitch _expression_="#methodName#">
            <cfcase value="save">
                <cfset recordInHistory(arguments.mi) />
            </cfcase>
            <cfcase value="delete">
                <cfset recordInHistory(arguments.mi) />
            </cfcase>
        </cfswitch>
       
        <cfreturn arguments.mi.proceed() />
    </cffunction>
   
   
    <cffunction name="recordInHistory" access="public" output="false" returntype="void">
        <cfargument name="mi" type="eits.coldspring.aop.MethodInvocation" required="true" />
        <cfset var lcl = StructNew() />
        <cfset var args = arguments.mi.getArguments () />
        <cfset var methodName = arguments.mi.getMethod().getMethodName() />
        <cfset var targetObjectMeta = GetMetaData(arguments.mi.getTarget()) />
        <cfset var objName = "" />
       
        <!--- If for whatever reason history is failing don't die --->
        <cftry>
            <cfif StructKeyExists(targetObjectMeta,'displayname')>
                <!--- TODO: remove DAO from display name --->
                <cfset objName = targetObjectMeta.displayname />
            </cfif>
           
            <cfset lcl.history = getHistoryService().CreateInstance() />
            <cfwddx action="" input="#args[1]#" output=" lcl.serialized" />
            <cfscript>
                lcl.history.setsite_id(1);
                lcl.history.setteam_id(4);
                lcl.history.settype(objName & '.' & methodName & '()');
                lcl.history.setdetails('');
                lcl.history.setinstance_wddx(lcl.serialized);
                lcl.history.setcommited_by(3);
                lcl.history.save();
            </cfscript>
            <cfcatch></cfcatch>
        </cftry>
    </cffunction>

   
    <cffunction name="getHistoryService" access="public" output="false" returntype=" eits.components.History.HistoryService">
        <cfreturn variables.instance.HistoryService />
    </cffunction>
    <cffunction name="setHistoryService" access="public" output="false" returntype="void">
        <cfargument name="HistoryService" type="eits.components.History.HistoryService" required="true" />
        <cfset variables.instance.HistoryService = arguments.HistoryService />
    </cffunction>

</cfcomponent>




<bean id="HistoryAroundAdvice" class="eits.components.History.HistoryAroundAdvice" singleton="true">
       <property name="HistoryService"><ref bean="HistoryService" /></property>
</bean>



Reply via email to