Skip to end of metadata
Go to start of metadata

Those tutorials reference AspectWerkz 2.0
They can run with both AspectWerkz 1.0 final and 2.0.RC1 unless otherwise specified.

You can also take a look at one of the external tutorials.

  • No labels


  1. Anonymous


    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

    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 package org.codehaus.aspectwerkz.joinpoint does not exist
    import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
    ^ cannot resolve symbol
    symbol : class JoinPoint
    location: class testAOP.MyAspect
    public void beforeGreeting(JoinPoint joinPoint) {
    ^ 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.

  2. Anonymous


    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,

    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(
    exec at org.codehaus.aspectwerkz.compiler.AspectWerkzC.compile(
    exec at org.codehaus.aspectwerkz.compiler.AspectWerkzC.main(
    exec Exception in thread "main"

  3. 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.

  4. Anonymous

    If u solved problems in executing Aspectw* pls tell me the steps to do... mail me if u r having any docs regarding this....

    thanx in advance

  5. 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\

  6. 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

        <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"/>


    expressionTesting is the name of the package

    but this doesn't work out ...

    seems there is some problem with the expression me to get the correct expression

    reply asap...