Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Why would one ever want to use Load Time Weaving?

I cannot find how to instruct AspectJ to weave only one aspect during the
load-time and the rest - during the compile-time.

After creating Load-Time Weaving AspectJ Run Configuration, the file
aop-ajc.xml has been created:
=====================================================================
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
	<aspects>
		<aspect name="com.shunra.poc.security.AuthorizerAspect"/>
		<aspect name="com.shunra.poc.logging.LoggerHolderAspect"/>
		<aspect name="com.shunra.poc.logging.LoggerAspect"/>
		<aspect name="com.shunra.poc.handlers.ResourceHandlerLoggerAspect"/>
		<aspect name="com.shunra.poc.handlers.ConverterProviderWorkaroundAspect"/>
		<aspect name="com.shunra.poc.UserRepositoryFailAspect"/>
		<aspect name="com.shunra.poc.ServiceLoggerAspect"/>
		<aspect name="com.shunra.poc.ResponseToStringAspect"/>
	</aspects>
	<weaver options="-showWeaveInfo -Xset:weaveJavaxPackages=true"/>
</aspectj>
=====================================================================

Now, I have added my own aop.xml:
=====================================================================
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
	<aspects>
	    <include within="com.shunra.poc.ResponseToStringAspect"/>
	</aspects>
</aspectj>
=====================================================================

Running the configuration displays may red lines on the Eclipse console in
the same spirit as the following one:
[WeavingURLClassLoader] error aspect 'com.shunra.poc.ServiceLoggerAspect'
woven into 'com.shunra.poc.Program' must be defined to the weaver (placed on
the aspectpath, or defined in an aop.xml file if using LTW).

So, I am doing something wrong. How can I enable just one aspect for LTW and
keep the rest for CTW in Eclipse?

Thanks.

--
View this message in context: http://aspectj.2085585.n4.nabble.com/Why-would-one-ever-want-to-use-Load-Time-Weaving-tp4181328p4197371.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top