How does AspectJ load-time-weaver find META-INF \ aop.xml?

I am trying to use load-time-weaving to associate perf4j with a program, but it does not seem to find aop.xml in my class path. Either this, or not the weaving of the aspect, because he does not find it. I have included verbose output from aop.xml, but I do not see any binding messages, errors, etc. Where is aspectJweaver looking for META-INF / aop.xml? How can I find out what he is looking for?

I tried using the direct path to import xml with this, but it did not work. -Dorg.aspectj.weaver.loadtime.configuration = C: \ DEV \ trunk \ Bin \ META-INF \ aop.xml

Note. The program works as intended using compilation in time, but I would prefer to use interlacing in time. I was also able to implement time overload using small test cases.

+4
source share
1 answer

The META-INF folder should be at the root of the class path. And the META-INF folder should contain the aop.xml file.

For stand-alone programs, you must start the JVM using a Java agent weaver. For instance:

-javaagent:pathto/aspectjweaver.jar 

From Spring:

 -javaagent:pathto/spring-agent.jar 

For more information about this, see the AspectJ Development Environment Guide .

If you are using a web container, you need to configure the container to perform time-interlacing. The SpringSource Reference Guide shows how to enable time loading with Tomcat.

+6
source

Source: https://habr.com/ru/post/1398086/


All Articles