Those tutorials reference AspectWerkz 2.0
They can run with both AspectWerkz 1.0 final and 2.0.RC1 unless otherwise specified.
- Hello World
- Hijacking Hello World
- How to integrate Aspects in J2EE apps with aop.xml
- How to write reusable aspects
You can also take a look at one of the external tutorials.
Labels

6 Comments
Hide/Show CommentsMay 06, 2005
Anonymous
Hello,
I'm not sure how to write the authors so I'll put a comment here and hope someone sees it.
Referring to the HelloWorld example I noticed that the second method "greet" is of type String but does not have a return statement in the execution part. I added that and the code compiled fine.
Also the command, in the tutorial, to recompile HelloWorld with AspectWorksz 2.0 is
javac -d target -classpath $ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.RC1.jar MyAspect.java
I could not get this to work because the zip file does not contain aspectwerkz-2.0.RC1.jar. I tried many of the other jar files but I kept getting the following:
C:\testAOP>javac -d target -classpath $ASPECTWERKZ_HOME/lib/aspectwerkz-2.0.RC1.
jar MyAspect.java
MyAspect.java:3: package org.codehaus.aspectwerkz.joinpoint does not exist
import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
^
MyAspect.java:7: cannot resolve symbol
symbol : class JoinPoint
location: class testAOP.MyAspect
public void beforeGreeting(JoinPoint joinPoint) {
^
MyAspect.java:11: cannot resolve symbol
symbol : class JoinPoint
location: class testAOP.MyAspect
public void afterGreeting(JoinPoint joinPoint) {
^
3 errors
I hope someone can advise and fix the problems in this example.
Sep 01, 2005
Anonymous
Hello,
I'am trying to build the first simple example but keep getting complains about org/xml/sax/EntityResolver that could not be found. I'v been on this al day now and tried every jdk / xml lib etc. It propbably has got to do with my configuration but it is driving me nuts so every suggestion is highly appreciated , i cannot wait to start with AOP.
Thanks upfront,
Dennis
exec []META-INF>set ASPECTWERKZ_HOME=[]aspectwerkz-2.0\aspectwerkz-2.0
exec java.lang.NoClassDefFoundError: org/xml/sax/EntityResolver
exec at org.codehaus.aspectwerkz.definition.DefinitionLoader.getDefaultDefinition(DefinitionLoader.java:49)
exec at org.codehaus.aspectwerkz.compiler.AspectWerkzC.compile(AspectWerkzC.java:667)
exec at org.codehaus.aspectwerkz.compiler.AspectWerkzC.main(AspectWerkzC.java:721)
exec Exception in thread "main"
Sep 02, 2005
Anonymous
another (working) day, solved the xml thing but had so many other issues that i am off now , bye bye see you later, this is killing me man.
Oct 17, 2005
Anonymous
Hi,
If u solved problems in executing Aspectw* pls tell me the steps to do... mail me if u r having any docs regarding this....
samu_3000@rediffmail.com
thanx in advance
samu
Dec 14, 2005
Anonymous
you have to do this operations to solve the problem:
1) C:\aspectwerkz-2.0\bin>edit aspectwerkz.bat
2) insert this strings after the istruction @ECHO OFF
set aspectwerkz_version=2.0
set aspectwerkz_home=c:\aspectwerkz-2.0
set java_home=c:\programmi\java\jre1.5.0\lib\ext\qtjava.zip
Sep 03, 2006
Kunal Kejriwal
hi
I want to weave my advice before and after public methods of public class. I tried using execution AND within pointcut() together to limit the scope...
The XML is used is
<aspectwerkz>
<system id="AspectWerkzExample1">
<aspect class="expressionTesting.ExpressionAspect">
<pointcut name="greetMethod" expression="within(public expressionTesting.*) AND execution(public * *(..)) "/>
<advice name="beforeGreeting" type="before" bind-to="greetMethod"/>
<advice name="afterGreeting" type="after" bind-to="greetMethod"/>
</aspect>
</system>
</aspectwerkz>
note
expressionTesting is the name of the package
but this doesn't work out ...
seems there is some problem with the expression ....help me to get the correct expression
reply asap...