Hi again
A slight change in the implementation - instead of declaring the aspect in the xml, I've done it in the source code itself. So this is the source for the aspect:
Code:
package com.mot.dm.server;
import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class MethodProfiler {
protected final Logger logger = Logger.getLogger("com.mot.dm");
@Pointcut("execution(* com.mot.dm.common.service.AgencyService.addAgency(..))")
public void profileMethod(ProceedingJoinPoint pjp) throws Throwable {
logger.info("In profileMethod");
}
}
The snippet from the application context:
Code:
<!-- Enabeling the aspect support -->
<bean class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" />
<!-- The aspect source -->
<bean id="methodTimeProfiler" class="com.mot.dm.server.MethodProfiler"/>
Sadly enough this setup yields exactly the same exception as the other approach:
Code:
Error creating bean with name 'permissionEvaluator' defined in
ServletContext resource [/WEB-INF/dms-security.xml]: Cannot resolve reference to
bean 'aclService' while setting constructor argument; nested exception is org.s
pringframework.beans.factory.BeanCurrentlyInCreationException: Error creating be
an with name 'aclService': Bean with name 'aclService' has been injected into ot
her beans [accessControlManager] in its raw version as part of a circular refere
nce, but has eventually been wrapped. This means that said other beans do not us
e the final version of the bean. This is often the result of over-eager type mat
ching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turne
d off, for example.
This actually puzzles me a little, because I've setup the aspect to only apply to "com.mot.dm.common.service.AgencyService.addAgency (..)", but still Spring tries to apply the aspect to the AclService class, which is in a complete different package - in other words the pointcut setup only comes into play during run-time and not during start-up (which I had hoped).
Any way I can restrict Spring in setting up the aspect on only the beans I need?
Thanx
Jens