简体   繁体   中英

AspectJ load-time weaving + Spring 3.0.5.RELEASE + Tomcat 7 not working

I am trying to figure out why load-time weaving is not working yet for my web application. For my normal application (not webapp) it is working.

The test-project can be found on github (github/peterbollen/helloLtw): helloLtwAspect

When I start the application, the logs show that the load-time weaver is working ( view log ). But when I trigger EchoServlet, the EchoAspect is not getting woven in ( view log ).

Does anyone have an idea? Feel free to check out the code and try yourself (I tested the README :)) Thanks for any advice ;-)

UPDATE 1

Load-time weaving is working when using javaagent aspectjweaver instead of spring-instrument.

Why? Do a search for "Load-Time-Weaving differences between aspectj-weaver and spring-weaver". I can't paste the link (not enough credits :-)).

UPDATE 2

Updated the github code too.

There is a bug in how tomcat 7 supports servlets 3.0 which causes Load Time Weaving to totally beak, details and work around are located at the URLS below.

https://jira.springsource.org/browse/SPR-7440 https://issues.apache.org/bugzilla/show_bug.cgi?id=52549 https://issues.apache.org/bugzilla/show_bug.cgi?id=52444

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM