jcabi-aspects
jcabi-aspects copied to clipboard
Example of how to do compile time weaving for web application deployed under JBoss?
I have struggled for 2 days trying to get @Loggable
annotation working in my JBoss web application. Maven appears to correctly compile and weave the classes, but i am unable to get JBoss to use them.
My JAVA_OPTS are:
export JAVA_OPTS="-javaagent:/Users/mcirioli/aspectjweaver.jar -Xbootclasspath/a://Users/mcirioli/aspectjweaver.jar:/Users/mcirioli/jcabi-aspects-0.18.jar -Djboss.modules.system.pkgs=com.maintainj.aspect,com.maintainj.inst,org.aspectj,com.jcabi.aspects -Dorg.aspectj.tracing.enabled=false -Dorg.aspectj.tracing.factory=default -Daj.weaving.verbose=true -Dorg.aspectj.weaver.loadtime.configuration=file:/export/servers/jboss/standalone/deployments/idp.war/META-INF/aop.xml"
my aop.xml is:
<aspectj>
<aspects>
<include within="com.redhat.it.jboss.loginModules"/>
<include within="com.jcabi.aspects..*"/>
<!-- <aspect name="com.jcabi.aspects.Loggable" /> -->
<aspect name="com.redhat.it.jboss.loginModules.Loggable"/>
<aspect name="com.redhat.it.jboss.loginModules.StaticLoginModule$AjcClosure1" />
</aspects>
<weaver options="-showWeaveInfo -verbose">
<!--Note: the two .. are really important -->
<include within="com.redhat.it.jboss.loginModules..*"/>
<include within="com.jcabi.aspects..*"/>
</weaver>
</aspectj>
If i uncomment the line:
<!-- <aspect name="com.jcabi.aspects.Loggable" /> -->
then i get errors complaining that com.jcabi.aspects.Loggable is not an aspect. If i leave it commented out, i don't get errors but I see messages saying "no aspects found" when my annotated class is loaded.
any ideas?
@yegor256 please dispatch this issue
@amihaiemil this task is yours, please help (see our key principles of work). If you have any technical questions, don't hesitate to ask right here... This task's budget is 30 mins. This is exactly how much will be paid when the problem explained above is solved. See this for more information
@dmarkov Please assign this to someone else
@dmarkov Please assign this to someone else
@amihaiemil deducted 30 from your rating :(
@dmarkov Please assign this to someone else
@amihaiemil I will assign somebody else to this issue
Using load time weaving by adding java agent for web application it is working fine but after some time like 15 to 30 hrs my application on 4 nodes got unresponsive one by one in the duration of 10 to 2c mins and showing proxy error .... Port for all nodes is unreachable. any suggestion ????