Re: [aspectwerkz-user] help with aspect not weaved
Alexandre Vasseur <[email protected]> Thu, 23 Jun 2005 09:37:55 +0200
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
HI The following may help (I assume you are using 2.0) Use -Daspectwerkz.transform.details=true to see if the pointcut captures what it should. Use -Daspectwerkz.transform.verbose=true (or -verbose:class) to see when the ejbPrioEJBHelper class gets weaved and loaded (I am assuming you are using load time weaving). I don' t understand what you mean by "all Aspects.aspectOf methods throw an exception saying that no aspect is found" Could you provide more details ? Also I see you are using "perInstance" with a call pointcut. I would say this is a flaw that we unfortunately provide. You should consider using a perTarget(...some pointcut....) where some pointcut captures the creation of the ejbPrionEJBHelper instances. perInstance is likely to be perInstance from the caller point of view and you seem to wish the callee in this case. Alex On 6/22/05, [email protected] <[email protected]> wrote: > Hi, > > I have the following aspect: > > <aspect name="test.com.ubs.firc.support.aspect.GenericMethodDecorator" deployment-model="perInstance"> > <pointcut name="helper" expression="call(* com.ubs.firc.credit..ejbPrionEJBHelper.*(..))"/> > <advice name="decorate" type="around" bind-to="helper"/> > </aspect> > > in my aop.xml. Basically, I want to put an around advice around all methods of the class 'ejbPrionEJBHelper'. The aspect is not applied as all Aspects.aspectOf methods throw an exception saying that no aspect is found. I put the verbose mode to trace all AspectWerkz activity, and I see things like this in the console: > > sun.misc.Launcher$AppClassLoader@1813fac@25247660:com.ubs.firc.credit.jrisk2003_2.external.valuation.ExternalValuationDebug[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.OperatingSystem[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.MiscUtilities[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.io.VFSManager[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.JARClassLoader[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.io.VFS[main] > sun.misc.Launcher$AppClassLoader@1813fac@25247660:org.gjt.sp.jedit.io.FileVFS[main] > > etc... > > However, there's no trace of loading of my class of interest 'ejbPrionEJBHelper'. Does that mean that AspectWerkz simply never intersepts the loading of that class (I'm sure it eventually gets loaded because I instantiated it)? I also tried putting the full package name instead of the '..' construct. This is not running in an EJB container, nevermind the name of ejbPrionEJBHelper - it's a simple helper class that doesn't use J2EE API. > > Any idea how I could debug this problem? > > Thanks, > Boris > > Visit our website at http://www.ubs.com > > This message contains confidential information and is intended only > for the individual named. If you are not the named addressee you > should not disseminate, distribute or copy this e-mail. Please > notify the sender immediately by e-mail if you have received this > e-mail by mistake and delete this e-mail from your system. > > E-mail transmission cannot be guaranteed to be secure or error-free > as information could be intercepted, corrupted, lost, destroyed, > arrive late or incomplete, or contain viruses. The sender therefore > does not accept liability for any errors or omissions in the contents > of this message which arise as a result of e-mail transmission. If > verification is required please request a hard-copy version. This > message is provided for informational purposes and should not be > construed as a solicitation or offer to buy or sell any securities or > related financial instruments. > >