<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
<aop:config>
<aop:aspect ref="logger">
<aop:pointcut id="dbmethod" expression="execution(* com.cet.peccore.DbInterfaceForPG.SetupTableForPG.*(..))" />
<aop:before pointcut-ref="dbmethod" method="LogBefore" />
<aop:after pointcut-ref="dbmethod" method="LogAfter" />
</aop:aspect>
</aop:config>
<bean id="dbInterface" class="com.cet.peccore.DbInterface.DbInterface" autowire="byType"/>
<bean id="setupTable" class="com.cet.peccore.DbInterfaceForPG.SetupTableForPG"/>
<bean id="logger" class="com.cet.peccore.PecTrend.util.MyLogger"/>
</beans>
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Cannot create inner bean '(inner bean)#29daf3' 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)#29daf3': Cannot resolve reference to bean 'dbmethod' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbmethod': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
- <dependency>
- <groupId> org.aspectj</groupId >
- <artifactId> aspectjweaver</artifactId >
- <version> 1.8.7</version >
- </dependency>