私はthisサイトで単純なaopの例を実行しようとしています。私は瓶aspectjweaver、スプリングAOPとAspectJのを持っている:私は "AABBCC" .toLowerCase()のようにTest.javaでこの例を実行すると単純なAOPの例のUnsupportedPointcutPrimitiveException
@Aspect
public class StringAspect {
@Pointcut("call(* String.toLowerCase())")
public void toLowerCasePointcut() {}
@Around("toLowerCasePointcut()")
public String toLowerCaseAroundAdvice(ProceedingJoinPoint joinPoint) throws Throwable {
String text = ((String) joinPoint.getTarget()).toUpperCase();
return text;
}
}
は、私はこの例外を取得します。
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean ... Initialization of bean failed; nested exception is org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException: Pointcut expression call(* String.toLowerCase()) contains unsupported pointcut primitive 'call'
春AOPが含まれている「コール」が、AspectJのウィービングが動作していない理由を、あなたのアイデアを持っていますdoesntの?ありがとうございました。
編集:
は私の春の設定ファイルでは、私が唯一@aspect注釈付きクラスと<aop:aspectj-autoproxy />
のBean定義を持っています。 私の瓶は:spring-aop-3.0.5、aopalliance、aspectjrt1.6.8、aspectjweaver1.5.0
こんにちは、私の質問を編集しappconfig.xmlとjar情報を追加しました。悪いことがありますか?ちなみに、もし私がEclipseプラグインを使っているのなら、それはEclipse IDE上で動かすべきですか?アプリケーションをサーバーにデプロイしたいのですが? – asyard
最後のセクションで、AspectJ製織の仕組みをより深く理解していただければ幸いです。 – Espen
Espenに感謝、それは非常に便利です。 – asyard