I'm attempting to setup the Spring AoP framework and I don't want to depend on AspectJ, so I'm declaring my aspects, advice etc in a bean xml configuration file similar to the following:
<bean id="systemAuthorizationsAspect" class="com.cp.pm.systemsettings.SystemAuthorizationsAspect" >
<property name="sysAuthorizations" ref="authorizations" />
</bean>
<bean id="authorizations" class="com.hp.cp.pm.systemsettings.SystemAuthorizationsImpl">
<property name="authSettingsRegistry" ref="systemSettingsRegistry" />
</bean>
<aop:config>
<aop:aspect id="createPlanAspect" ref="systemAuthorizationsAspect">
<aop:before pointcut="execution(* com.hp.cp.web.api.plan.PlanApi.createPlan(..))" method="authorizePlanCreation"/>
</aop:aspect>
</aop:config>
I recieve the following error whenever I specify a pointcut as seen above:
BeanPostProcessor before instantiation of bean failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0':
Cannot create inner bean '(inner bean)' of type [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] while setting constructor argument;
nested exception is org.springframework.beans.
factory.BeanCreationException:
Error creating bean with name '(inner bean)':
Cannot create inner bean '(inner bean)' of type [org.springframework.aop.aspectj.AspectJExpressionPointcut] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)':
Instantiation of bean failed; nested exception is **java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException**
I can make this work when I include the aspectjweaver.jar. Yet this should not have to be the case. Any thoughts?
Thanks in advance