Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] declare parents on interface sometimes failing

Hi Jim,

Whether the aspect can do the weaving (in this case change the
parents) can depend upon which classloader loads the type targetted
for weaving.  If you add '-debug' to the aop.xml weaver options
section it will produce messages for which types the weaver is being
passed for weaving (more details here:
http://andrewclement.blogspot.com/2009/02/load-time-weaving-basics.html
).  If your HttpSession doesn't get passed to the weaver, you won't
see a log entry and it must be getting loaded 'somewhere else' higher
up.

Are you able to target the MockHttpSession class instead? (if that is
always being loaded by the correct loader)

Did you try the Spring AOP forums:
http://forum.springsource.org/forumdisplay.php?f=31 - lots of experts
on there, in this kind of area.

cheers,
Andy

2009/11/10 Jim Sellers <jim.sellers@xxxxxxxxx>:
> Hi all.
>
> I'm having an issue where sometimes the "declare parents" code does not
> properly change the parent of the class.
>
> Declare parents is set up on HttpSession.  When using spring's
> MockHttpSession (which implements HttpSession), it seems that the parent
> class doesn't get changed correctly, so it ends up with a
> AbstractMethodError.
> java.lang.AbstractMethodError:
> org.springframework.mock.web.MockHttpSession.getHashOnSet()Ljava/util/Map;
>
> *However*, if HttpSession is in the non-test class that is being called by
> the test, the declare parents command seems to run correctly.
>
> Has any one come across this?  I'm going a bit nuts because I can't seem to
> figure out a consistent way to be able to get this working.
>
> Any help would be greatly appreciated.
>
> My original writeup of what I did:
> http://www.beernut.ca/jim/archives/005157.html
>
> Thanks for your time,
> Jim
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top