[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ajdt-dev] Need help in running a simple aspect

I have following in the folder: C:\aspectj1.5\doc\examples

test1\TestAspect.java

test2\HelloWorld.java

 

Source:

package test2;

class HelloWorld {

  public static void main(String[] args) {

                  System.out.println("in here");

     new HelloWorld().printMessage();

  }

 

  void printMessage() {

    System.out.println("Hello world in java !");

  }

}

 

 

package test1;

public aspect TestAspect {

 

pointcut printouts(): call(* print*(..));

  before(): printouts() {

    System.out.println("*** Entering printMessage ***");

  }

  after():  printouts() {

    System.out.println("*** Exiting printMessage ***");

  }

}

 

 

I run the following from command line:

 

C:\aspectj1.5\doc\examples>ajc -target 1.5 -verbose test1/TestAspect.java test2/

HelloWorld.java

directory classpath entry does not exist: C:\Java\jdk1.5.0_05\jre\lib\i18n.jar

directory classpath entry does not exist: C:\Java\jdk1.5.0_05\jre\lib\sunrsasign

.jar

zipfile classpath entry does not exist: C:\Java\jdk1.5.0_05\jre\classes

Pipelining compilation

compiling C:\aspectj1.5\doc\examples\test1\TestAspect.java

weaver operating in reweavable mode.  Need to verify any required types exist.

woven aspect test1.TestAspect (from C:\aspectj1.5\doc\examples\test1\TestAspect.

java)

compiling C:\aspectj1.5\doc\examples\test2\HelloWorld.java

woven class test2.HelloWorld (from C:\aspectj1.5\doc\examples\test2\HelloWorld.j

ava)

 

Compiler took 1547ms

 

C:\aspectj1.5\doc\examples>java test2.HelloWorld

 

This command does NOT return anything; it just keeps running without completing.

I had to kill it to return to command prompt.

 

Please help in solving this. Is there anything wrong with the code?

 

Thanks

arvind