Re: anything wrong?- beginner problem

Jonas BonĂ©r <[email protected]> Sat, 03 May 2003 12:42:31 +0200
Newsgroups gmane.comp.java.aspectwerkz
Message-ID <[email protected]>
Hi.

Which method/methods are you trying to advise?

When I look at your Notepad.java I can't see any methods named something 
starting with the letter n. If you want to log all methods in the class 
use: .*

- Jonas

Zhang Weishan wrote:
> Hello everyone,
> 
>   I tried to run the simple logging advice with a Notepad example, but I 
> was in trouble. All the used files, including the xml definition file, 
> compiled and source logging advice, compiled and source Notepad reside 
> in one directory named test. I jar the complied logging advice and 
> Notepad into a notepad.jar.
> 
>   The logging advice which is almost the same as the original one, the 
> only difference is that I removed the package declaration to make life 
> easier.
> 
>   Here is the xml definition file which resides:
> 
> <aspectwerkz>
> 
>     <advice name="xmt"
> 
>         advice="LoggingAdvice"
> 
>         deploymentModel="perClass"/>
> 
>  
> 
>     <aspect class="Notepad">
> 
>         <pointcut type="method" pattern="n.*">
> 
>             <advice-ref name="xmt"/>
> 
>         </pointcut>
> 
>     </aspect>
> 
>  
> 
>   Here is the command I used to invoke the framework.
> 
> C:\aspectwerkz>aspectwerkz -cp 
> test/notepad.jar;lib/commons-collections-2.1.jar
> 
> -Daspectwerkz.definition.file=test/samples.xml 
> -Daspectwerkz.metadata.dir=_metaD
> 
> ata Notepad
> 
>  
> 
> The notepad runs but there is no logging info displayed in the console. 
> No matter what the method pattern, for example, set.*, n.*, it simply 
> did not work.
> 
>  
> 
> Thanks,
> 
> Weishan
> 
>  
> 


-- 
Jonas
http://freeroller.net/page/jboner





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf