Thinker.javajava.lang.IllegalArgumentException가 : 오류 : 0 공식적인 언 바운드에서 포인트 컷에
package springdemo2;
public interface Thinker {
void thinkOfSomething(String thoughts);
}
Volunteer.java
package springdemo2;
public class Volunteer implements Thinker{
private String thoughts;
@Override
public void thinkOfSomething(String thoughts) {
this.thoughts=thoughts;
}
public String getThoughts(){
return thoughts;
}
}
MindReader.java
package springdemo2;
public interface MindReader {
void interceptThoughts(String thoughts);
String getThoughts();
}
,210
Magician.java
package springdemo2;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class Magician implements MindReader {
private String thoughts;
@Pointcut("execution(* springdemo2."
+ "Thinker.thinkOfSomething(String)) and args(thoughts)")
public void thinking(String thoughts){
}
@Override
@Before("thinking(thoughts)")
public void interceptThoughts(String thoughts) {
this.thoughts=thoughts;
System.out.println("Advice method intercepted Thoughts..."+thoughts);
}
@Override
public String getThoughts() {
return thoughts;
}
}
XML (봄)을
내 XML 파일에 <aop:aspectj-autoproxy/>
을 포함했다.
java.lang.IllegalArgumentException: error at ::0 formal unbound in
pointcut
나는 그것을 믿을 수 없다! 'and'연산자는 xml 구성에서는 유효하지만 주석이 달린 버전에서는 유효하지 않습니다. 감사! –