Search code examples
javawebsphereclasspathaopaspectj

classpath in websphere application server for aspectj agent


I am working on a java aspectj agent which measues the response time of all methods.

I followed below steps to test the aspectj on linux development environment. ajc -source 1.7 .java -outxml -outjar ResponseTime.jar

java -javaagent:/home/hadoop/aspectj1.7/lib/aspectjweaver.jar -cp "$CLASSPATH:code:ResponseTime.jar:/home/hadoop/aspectj1.7/lib/aspectjrt.jar" Application

i have websphere application server in my productions server and when i tried above vm arguments my Load time weaving was not happening.

i need help on how we can set classpath for "$CLASSPATH:code:ResponseTime.jar" in web sphere..


Solution

    1. Login to WebSphere Admin console using admin user
    2. Follow below steps to update ClassPath and VM arguments of server

    a. Select the Servers -> Server Types -> WebSphere Application Server -> Resource -> Java and Process Management -> Process definition

    c Add absolute path of Aspectj jars to the classpath text area window .jar aspectjweaver.jar aspectjrt.jar

    d. Add below comment into the Generic JVM arguments tab -javaagent:aspectjweaver.jar -Dorg.aspectj.weaver.Dump.exception=false -