@AspectJ AOP на основе Spring 3.1

Я пытаюсь запустить AOP на основе @AspectJ в Spring 3.1 & не в состоянии правильно настроить pointcut Pointcut и следующие рекомендации:

: срезы в

@Pointcut("execution(* point.*.*(..))")
public void selectAll() {}

после совета:

@After("selectAll()")
public void afterAdvice() {
    System.out.println("profile has been setup.");
}

перед советом: &

@Before("selectAll()")
public void beforeAdvice() {
    System.out.println("Going to setup profile.");
}

 запустить основную программу, я получил исключение:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'student' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut selectAll
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

хотя, когда я даю выражение pointcut в методах beforeAdvice () и afterAdvice (), метод PointCuts при удалении все работает нормально

@Before("execution(* point.*.*(..))")
public void beforeAdvice() {
    System.out.println("Going to setup profile.");
}

 @After("execution(* point.*.*(..))")
public void afterAdvice() {
    System.out.println("profile has been setup.");
}

я пытаюсь применить pointcut к методу класса Student:

package point;

 public class Student{
private Integer age;
private String name;

public void setAge(Integer age) {
    this.age = age;
}

public Integer getAge() {
    System.out.println("Age : " + age);
    return age;
}

public void setName(String name) {
    this.name = name;
}

public String getName() {
    System.out.println("Name : " + name);
    return name;
}

public void printThrowException() {
    System.out.println("Exception raised");
    throw new IllegalArgumentException();
}
 }

конфигурация пружины xml:





 
    
     



Jar-файл используется:

aopalliance-1.0.jar
asm-3.3.1.jar
aspectj-1.7.1.jar
aspectjrt-1.6.8.jar
aspectjtools-1.5.4.jar
aspectjweaver-1.6.2.jar
cglib-2.2.2.jar

с пружиной 3,1 баночки

Ответы на вопрос(1)

Ваш ответ на вопрос