I have created an executable jar of my scala
application. I am trying to use AspectJ Load-Time-Weaving
. The aspectj is working as expected, however, it is taking a huge amount of time to start the jar file after the LTW.
My AOP.xml is as below:
<aspectj>
<aspects>
<aspect name="com.app.module.aspect.WorkflowInterceptor"/>
</aspects>
<weaver options="-verbose">
<dump within="com.app.*"/>
<!--<include within="com.app.common.features..*"/>-->
</weaver>
</aspectj>
When I run the jar file as
java -javaagent:aspectjweaver-1.8.4.jar -jar myapp.jar
The jar file starts after 15 min, sometime even 30 min. I tried to reduce the aspectj weaving by using include
but not working. If I do not provide dump
, the aspect is not getting invoked at all.
Can anyone help me to solve this issue ?
EDIT:
I removed the <dump>
and used <include within ..>
. It is working, but still taking a lot of time (5 min )