How to resolve the error “The specified aspect ‘AspectLogger’ cannot be found” in AspectJ LTW setup?

I am trying to set up AspectJ load-time weaving (LTW) for logging method execution time in my Java web application. It is a webapp written using Servlets, jsp (No Spring used) and deployed on jBoss EAP 7.2 written using Servlets and jsp (No Spring used).

I have created an aspect and packaged it into a JAR file along with the aop.xml configuration file. However, when I run my application, I encounter the following error: The specified aspect ‘AspectLogger’ cannot be found.

Here is the full log in jBoss console:

2024-08-05 09:45:05,159 ERROR [stderr] (MSC service thread 1-2) [ModuleClassLoader@17497425] info AspectJ Weaver Version 1.9.2 built on Wednesday Oct 24, 2018 at 15:43:33 GMT
2024-08-05 09:45:05,160 ERROR [stderr] (MSC service thread 1-2) [ModuleClassLoader@17497425] info register classloader org.jboss.modules.ModuleClassLoader@17497425
2024-08-05 09:45:05,161 ERROR [stderr] (MSC service thread 1-2) [ModuleClassLoader@17497425] info using configuration /C:/apps/jboss-eap-7.2.0/standalone/lib/aop.xml
2024-08-05 09:45:05,163 ERROR [stderr] (MSC service thread 1-2) [ModuleClassLoader@17497425] info register aspect AspectLogger
2024-08-05 09:45:05,164 ERROR [stderr] (MSC service thread 1-2) [ModuleClassLoader@17497425] error The specified aspect 'AspectLogger' cannot be found

Here is what I have done so far.

1. Project Structure:

AspectLogger.java

package com.sample;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;

public class AspectLogger {
    @Around("execution(* com.webservices..*(..))")
    public Object logExecutionTime(ProceedingJoinPoint joinPoint) throws Throwable {
         
         long start = System.currentTimeMillis();

         Object proceed = joinPoint.proceed();

         long executionTime = System.currentTimeMillis() - start;
         System.out.println(joinPoint.getSignature() + " executed in " + executionTime + "ms");

         return proceed;
    }
}

aop.xml

<aspectj>
    <weaver options="-verbose -showWeaveInfo">
        <include within="com.webservices..*"/>
    </weaver>
    <aspects>
        <aspect name="AspectLogger"/>
    </aspects>
</aspectj>

To package the aspect as jar file I export the project as jar in Eclipse which created the jar with below structure.(Do I have to use ajc command to compile and package? If so, please provide me the suitable command. Tried different arguments with ajc to complie AspectLogger.java into AspectLogger.class, but still got the same error.)

C:.
|   .classpath
|   .project
|   
+---com
|   ---sample
|           AspectLogger.class
|           
+---lib
|       aspectj-1.9.2.jar
|       aspectjrt-1.9.2.jar
|       aspectjtools-1.9.2.jar
|       aspectjweaver-1.9.2.jar
|       
---META-INF
        aop.xml
        MANIFEST.MF

Java Agent Argument:
I am using the following JVM argument to enable AspectJ weaving:

set "ASPECT_HOME=C:appsjboss-eap-7.2.0standalonelib"

set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.aspectj -Dorg.aspectj.weaver.loadtime.debug=true -Dorg.aspectj.weaver.loadtime.configuration=%ASPECT_HOME%aop.xml -Xbootclasspath/a:%ASPECT_HOME%aspectjweaver-1.9.2.jar:%ASPECT_HOME%SampleLogger.jar -Dorg.aspectj.tracing.enabled=false -Dorg.aspectj.tracing.factory=default"

rem Uncomment below line to enable Aspect load-time weaving
set "JAVA_OPTS=%JAVA_OPTS% -javaagent:%ASPECT_HOME%aspectjweaver-1.9.2.jar -cp %ASPECT_HOME%*"

Here is the content of my %ASPECT_HOME%

When I start the jboss, the server is starting and all my webapps are deployed successfully. Even though I specified aop.xml in -Dorg.aspectj.weaver.loadtime.configuration=%ASPECT_HOME%aop.xml , I still kept it in META-INF just to be safe. If removed it in JVM options and only have the aop.xml in META-INF, it is not even found by weaver and nothing is coming up in jboss logs.

Please help me identify what the issue is and help getting the logger running.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật